{"record":{"id":"193ad8969fb4e1bd","repo":"OpenBB-finance/OpenBB","slug":"type-v-not-recognized-valid-types-join","errorCode":null,"errorMessage":"Type '{v}' not recognized. Valid types: {', '.join(sorted(valid_types))}","messagePattern":"Type '(.+?)' not recognized\\. Valid types: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/extensions/mcp_server/openbb_mcp_server/models/mcp_config.py","lineNumber":78,"sourceCode":"    @field_validator(\"type\")\n    @classmethod\n    def validate_type(cls, v: str) -> str:\n        \"\"\"Validate type is a recognized type string.\"\"\"\n        valid_types = {\n            \"str\",\n            \"string\",\n            \"int\",\n            \"integer\",\n            \"float\",\n            \"bool\",\n            \"boolean\",\n            \"list\",\n            \"dict\",\n            \"any\",\n            \"Any\",\n        }\n        if v not in valid_types:\n            raise ValueError(\n                f\"Type '{v}' not recognized. Valid types: {', '.join(sorted(valid_types))}\"\n            )\n        return v\n\n\nclass PromptConfigModel(BaseModel):\n    \"\"\"Model for validating individual prompt configurations.\"\"\"\n\n    name: str | None = Field(\n        default=None, description=\"Name of the prompt (auto-generated if not provided)\"\n    )\n    description: str | None = Field(\n        default=None, description=\"Description of the prompt\"\n    )\n    content: str = Field(description=\"Template content with {variable} placeholders\")\n    arguments: list[ArgumentDefinitionModel] = Field(\n        default_factory=list, description=\"Argument definitions for the prompt\"\n    )","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/extensions/mcp_server/openbb_mcp_server/models/mcp_config.py#L60-L96","documentation":"Pydantic validation error on ArgumentDefinitionModel.type: the type string is not in the recognized set {str, string, int, integer, float, bool, boolean, list, dict, any, Any}. Types are declared as strings in MCP configs, so typos or unsupported types (e.g. 'number', 'array', 'datetime') are caught here at load time; the message lists the sorted valid options.","triggerScenarios":"Writing type: number or type: array (JSON-Schema style) in an MCP config; type: datetime or other Python types not in the whitelist; case variants like 'String' or 'INT' which are not accepted.","commonSituations":"Porting JSON-Schema or OpenAPI parameter types directly; authors assuming any Python type name works; case-sensitivity surprises ('Any' is valid but 'any' also is, while 'string' works and 'String' does not).","solutions":["Map JSON-Schema types: number → float, array → list, object → dict, integer → int.","Use one of the exact strings from the error's valid-types list, respecting case for 'Any'.","For unknown shapes use 'any'."],"exampleFix":"# before\narguments:\n  - name: limit\n    type: number\n\n# after\narguments:\n  - name: limit\n    type: float","handlingStrategy":"validation","validationCode":"VALID_TYPES = {\"str\", \"string\", \"int\", \"integer\", \"float\", \"bool\", \"boolean\", \"list\", \"dict\", \"any\", \"Any\"}\nJSON_SCHEMA_MAP = {\"number\": \"float\", \"array\": \"list\", \"object\": \"dict\"}\n\ndef coerce_type(t: str) -> str:\n    return JSON_SCHEMA_MAP.get(t, t) if t in VALID_TYPES or t in JSON_SCHEMA_MAP else (_ for _ in ()).throw(ValueError(f\"bad type {t}\"))","typeGuard":"def is_recognized_type(t: str) -> bool:\n    return t in {\"str\", \"string\", \"int\", \"integer\", \"float\", \"bool\", \"boolean\", \"list\", \"dict\", \"any\", \"Any\"}","tryCatchPattern":null,"preventionTips":["Translate JSON-Schema/OpenAPI types (number/array/object) before writing MCP configs.","Copy the valid-type list from the error message into your config linter.","Watch case sensitivity: 'Any' is valid, 'String' is not."],"tags":["openbb","mcp","pydantic","config-validation","types"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}