{"record":{"id":"e83206a2dc79331c","repo":"langchain-ai/langchain","slug":"unsupported-tool-call-schema-tool-tool-call-sche","errorCode":null,"errorMessage":"Unsupported tool call schema: {tool.tool_call_schema}. Tool call schema must be a JSON schema dict or a Pydantic model.","messagePattern":"Unsupported tool call schema: (.+?)\\. Tool call schema must be a JSON schema dict or a Pydantic model\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/core/langchain_core/utils/function_calling.py","lineNumber":354,"sourceCode":"        The function description.\n    \"\"\"\n    is_simple_oai_tool = (\n        isinstance(tool, langchain_core.tools.simple.Tool) and not tool.args_schema\n    )\n    if tool.tool_call_schema and not is_simple_oai_tool:\n        if isinstance(tool.tool_call_schema, dict):\n            return _convert_json_schema_to_openai_function(\n                tool.tool_call_schema, name=tool.name, description=tool.description\n            )\n        if issubclass(tool.tool_call_schema, (BaseModel, BaseModelV1)):\n            return _convert_pydantic_to_openai_function(\n                tool.tool_call_schema, name=tool.name, description=tool.description\n            )\n        error_msg = (  # type: ignore[unreachable]\n            f\"Unsupported tool call schema: {tool.tool_call_schema}. \"\n            \"Tool call schema must be a JSON schema dict or a Pydantic model.\"\n        )\n        raise ValueError(error_msg)\n    return {\n        \"name\": tool.name,\n        \"description\": tool.description,\n        \"parameters\": {\n            # This is a hack to get around the fact that some tools\n            # do not expose an args_schema, and expect an argument\n            # which is a string.\n            # And Open AI does not support an array type for the\n            # parameters.\n            \"properties\": {\n                \"__arg1\": {\"title\": \"__arg1\", \"type\": \"string\"},\n            },\n            \"required\": [\"__arg1\"],\n            \"type\": \"object\",\n        },\n    }\n\n","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/langchain-ai/langchain/blob/e32fa9a52eab3b61ad7a45399bfde59b3e580fc4/libs/core/langchain_core/utils/function_calling.py#L336-L372","documentation":"Error \"Unsupported tool call schema: {tool.tool_call_schema}. Tool call schema must be a JSON schema dict or a Pydantic model.\" thrown in langchain-ai/langchain.","triggerScenarios":"Raised when a tool's tool_call_schema is neither a JSON schema dict nor a Pydantic model (e.g. a plain class, TypedDict, or function) during conversion to an OpenAI tool.","commonSituations":"See trigger scenarios.","solutions":["Provide tool_call_schema as a JSON schema dict or a pydantic.BaseModel subclass.","If the schema is another type (e.g. a dataclass or TypedDict), convert it to a Pydantic model first."],"exampleFix":"tool.tool_call_schema = MyPydanticArgs  # or a JSON schema dict","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e32fa9a52eab3b61ad7a45399bfde59b3e580fc4","analyzedAt":"2026-08-14T18:42:09.092Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}