mirror of
https://github.com/open-webui/mcpo.git
synced 2026-11-05 01:27:39 +00:00
[PR #170] [MERGED] Fix: Handle MCP parameter names with 2 leading underscores #196
Labels
No labels
bug
can't reproduce
documentation
enhancement
good first issue
help wanted
invalid
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/mcpo#196
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/mcpo/pull/170
Author: @2underscores
Created: 6/4/2025
Status: ✅ Merged
Merged: 6/6/2025
Merged by: @tjbck
Base:
dev← Head:fix-leading-underscore-parameters📝 Commits (3)
1953aceFix: Handle parameter names with leading underscores in Pydantic models - Add field aliasing for parameters starting with '__' (e.g., __top, __filter) - Apply fix to both top-level and nested object properties - Use by_alias=True in model_dump to preserve original parameter names for MCP calls - Prevents Pydantic v2 NameError - Enables compatibility with Microsoft 365 MCP server and other OData-based APIs - Fixes #16093297c9Abstracted out alias checks and creation0d93fefrm debug logs📊 Changes
1 file changed (+53 additions, -4 deletions)
View changed files
📝
src/mcpo/utils/main.py(+53 -4)📄 Description
Add field aliasing for parameters starting with '__' (e.g., __top, __filter) - Apply fix to both top-level and nested object properties - Use by_alias=True in model_dump to preserve original parameter names for MCP calls - Prevents Pydantic v2 NameError. Enables compatibility with OData-based APIs.
Fixes feat #160 (IMO addressing incompatibility with some MCP interfaces is a bug fix, not a new feature)
Changelog Entry
Description
Fixes Pydantic v2 validation error when MCP servers use parameter names with leading underscores (e.g.,
__top,__filter) (e.g. any OData-based APIs that follow Microsoft Graph API conventions).Added
Fixed
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.