René's URL Explorer Experiment


Title: mcp_tool_to_langchain parameters conversion error · Issue #190 · SAP/cloud-sdk-python · GitHub

Open Graph Title: mcp_tool_to_langchain parameters conversion error · Issue #190 · SAP/cloud-sdk-python

X Title: mcp_tool_to_langchain parameters conversion error · Issue #190 · SAP/cloud-sdk-python

Description: Describe the Bug Bug Description mcp_tool_to_langchain in src/sap_cloud_sdk/agentgateway/converters.py builds the Pydantic args schema with every field typed as str (or str | None), regardless of the actual type declared in the MCP tool'...

Open Graph Description: Describe the Bug Bug Description mcp_tool_to_langchain in src/sap_cloud_sdk/agentgateway/converters.py builds the Pydantic args schema with every field typed as str (or str | None), regardless of t...

X Description: Describe the Bug Bug Description mcp_tool_to_langchain in src/sap_cloud_sdk/agentgateway/converters.py builds the Pydantic args schema with every field typed as str (or str | None), regardless of t...

Opengraph URL: https://github.com/SAP/cloud-sdk-python/issues/190

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcp_tool_to_langchain parameters conversion error","articleBody":"### Describe the Bug\n\n## Bug Description\n\n`mcp_tool_to_langchain` in `src/sap_cloud_sdk/agentgateway/converters.py` builds the\nPydantic args schema with every field typed as `str` (or `str | None`), regardless of\nthe actual type declared in the MCP tool's `input_schema`.\n\n## Root Cause\n\nLines 85–88 of `converters.py` iterate over property *keys* only and hard-code `str`:\n\n```python\nfields: dict[str, Any] = {\n    k: (str, ...) if k in required else (str | None, Field(default=None))\n    for k in properties          # ← values (the property schemas) are never read\n}\n```\n\nThe property schema values (e.g. `{\"type\": \"integer\"}`) are never consulted.\n\n## Impact\n\nWhen an LLM passes a non-string argument (e.g. `limit=10`, `active=true`), Pydantic\ncoerces it to a string (`\"10\"`, `\"true\"`) before forwarding it to `call_tool`. The MCP\nserver then rejects the call because it expects the native JSON type.\n\n## Affected types\n\nAll non-string JSON Schema types are affected: `integer`, `number`, `boolean`, `array`,\n`object`.\n\n## Reproduction\n\n```python\nfrom unittest.mock import AsyncMock\nfrom sap_cloud_sdk.agentgateway import MCPTool\nfrom sap_cloud_sdk.agentgateway.converters import mcp_tool_to_langchain\n\ntool = MCPTool(\n    name=\"search\",\n    server_name=\"s\",\n    description=\"d\",\n    input_schema={\n        \"type\": \"object\",\n        \"required\": [\"limit\"],\n        \"properties\": {\n            \"limit\": {\"type\": \"integer\"},\n            \"active\": {\"type\": \"boolean\"},\n        },\n    },\n    url=\"https://example.com/mcp\",\n)\n\nlc_tool = mcp_tool_to_langchain(tool, AsyncMock(), lambda: \"token\")\nfields = lc_tool.args_schema.model_fields\n\n# Both fields are `str` — should be `int` and `bool`\nprint(fields[\"limit\"].annotation)   # \u003cclass 'str'\u003e   ← bug\nprint(fields[\"active\"].annotation)  # str | None      ← bug\n```\n\n## Expected Fix\n\nMap JSON Schema `\"type\"` values to Python types before building the Pydantic model:\n\n| JSON Schema type | Python type |\n|------------------|-------------|\n| `\"string\"`       | `str`       |\n| `\"integer\"`      | `int`       |\n| `\"number\"`       | `float`     |\n| `\"boolean\"`      | `bool`      |\n| `\"array\"`        | `list`      |\n| `\"object\"`       | `dict`      |\n| *(missing/other)*| `Any`       |\n\n## Scope\n\nOnly `mcp_tool_to_langchain` in `agentgateway/converters.py` is affected. No other\nconverters exist in the codebase.\n\n\n### Steps to Reproduce\n\n1. Use mcp tool without string argument\n\n### Expected Behavior\n\n1. it should consider parameters other than string\n\n### Screenshots\n\n_No response_\n\n### Used Versions\n\n- Python version via `python --version`: ...\n- SAP Cloud SDK for Python version: ...\n- Framework version (if applicable, e.g., Flask, FastAPI): ...\n\n\u003cdetails\u003e\u003csummary\u003eInstalled packages via \u003ccode\u003epip list\u003c/code\u003e or \u003ccode\u003euv pip list\u003c/code\u003e\u003c/summary\u003e\n\n```\nPackage list here\n```\n\u003c/details\u003e\n\n\n### Code Examples\n\n```python\n# Your code here\n```\n\n\n### Stack Trace\n\n_No response_\n\n### Log File\n\n\u003cdetails\u003e\u003csummary\u003eLog file\u003c/summary\u003e\n...\n\u003c/details\u003e\n\n\n### Affected Development Phase\n\nGetting Started\n\n### Impact\n\nNo Impact\n\n### Timeline\n\n_No response_","author":{"url":"https://github.com/51acorsi","@type":"Person","name":"51acorsi"},"datePublished":"2026-06-26T20:57:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/190/cloud-sdk-python/issues/190"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:663464cd-1eb3-0b00-8f42-b5378cac308c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCC86:2395E2:257344:3394A8:6A5062C7
html-safe-noncec8e3c309855ca6c049f66d143fb7c593c5a5534c21e6daef151edd9773871b3f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzg2OjIzOTVFMjoyNTczNDQ6MzM5NEE4OjZBNTA2MkM3IiwidmlzaXRvcl9pZCI6IjU1NjI0NTIzOTA2NzY4MTY1ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3612e203c8b8960e126843861b8be006afe179093285f7de7907f6648c6365e0
hovercard-subject-tagissue:4755100371
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/SAP/cloud-sdk-python/190/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4a172dd1b064a34c66a2bbd68b32e8585f69e9fd426899190ddcbf7d9a7cee4b/SAP/cloud-sdk-python/issues/190
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4a172dd1b064a34c66a2bbd68b32e8585f69e9fd426899190ddcbf7d9a7cee4b/SAP/cloud-sdk-python/issues/190
og:image:altDescribe the Bug Bug Description mcp_tool_to_langchain in src/sap_cloud_sdk/agentgateway/converters.py builds the Pydantic args schema with every field typed as str (or str | None), regardless of t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:username51acorsi
hostnamegithub.com
expected-hostnamegithub.com
Noned6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb
turbo-cache-controlno-preview
go-importgithub.com/SAP/cloud-sdk-python git https://github.com/SAP/cloud-sdk-python.git
octolytics-dimension-user_id2531208
octolytics-dimension-user_loginSAP
octolytics-dimension-repository_id1187276298
octolytics-dimension-repository_nwoSAP/cloud-sdk-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1187276298
octolytics-dimension-repository_network_root_nwoSAP/cloud-sdk-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/SAP/cloud-sdk-python/issues/190#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FSAP%2Fcloud-sdk-python%2Fissues%2F190
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FSAP%2Fcloud-sdk-python%2Fissues%2F190
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=SAP%2Fcloud-sdk-python
Reloadhttps://github.com/SAP/cloud-sdk-python/issues/190
Reloadhttps://github.com/SAP/cloud-sdk-python/issues/190
Reloadhttps://github.com/SAP/cloud-sdk-python/issues/190
Please reload this pagehttps://github.com/SAP/cloud-sdk-python/issues/190
SAP https://github.com/SAP
cloud-sdk-pythonhttps://github.com/SAP/cloud-sdk-python
Notifications https://github.com/login?return_to=%2FSAP%2Fcloud-sdk-python
Fork 33 https://github.com/login?return_to=%2FSAP%2Fcloud-sdk-python
Star 18 https://github.com/login?return_to=%2FSAP%2Fcloud-sdk-python
Code https://github.com/SAP/cloud-sdk-python
Issues 6 https://github.com/SAP/cloud-sdk-python/issues
Pull requests 18 https://github.com/SAP/cloud-sdk-python/pulls
Actions https://github.com/SAP/cloud-sdk-python/actions
Projects https://github.com/SAP/cloud-sdk-python/projects
Security and quality 0 https://github.com/SAP/cloud-sdk-python/security
Insights https://github.com/SAP/cloud-sdk-python/pulse
Code https://github.com/SAP/cloud-sdk-python
Issues https://github.com/SAP/cloud-sdk-python/issues
Pull requests https://github.com/SAP/cloud-sdk-python/pulls
Actions https://github.com/SAP/cloud-sdk-python/actions
Projects https://github.com/SAP/cloud-sdk-python/projects
Security and quality https://github.com/SAP/cloud-sdk-python/security
Insights https://github.com/SAP/cloud-sdk-python/pulse
#191https://github.com/SAP/cloud-sdk-python/pull/191
mcp_tool_to_langchain parameters conversion errorhttps://github.com/SAP/cloud-sdk-python/issues/190#top
#191https://github.com/SAP/cloud-sdk-python/pull/191
https://github.com/NicoleMGomes
bugSomething isn't workinghttps://github.com/SAP/cloud-sdk-python/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/51acorsi
51acorsihttps://github.com/51acorsi
on Jun 26, 2026https://github.com/SAP/cloud-sdk-python/issues/190#issue-4755100371
NicoleMGomeshttps://github.com/NicoleMGomes
bugSomething isn't workinghttps://github.com/SAP/cloud-sdk-python/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.