Skip to content

Stop duplicating path parameter descriptions into tool prose#3149

Merged
jlowin merged 2 commits intomainfrom
fix/openapi-path-param-description
Feb 11, 2026
Merged

Stop duplicating path parameter descriptions into tool prose#3149
jlowin merged 2 commits intomainfrom
fix/openapi-path-param-description

Conversation

@jlowin
Copy link
Copy Markdown
Member

@jlowin jlowin commented Feb 11, 2026

format_simple_description was copying path parameter names and descriptions into the tool's prose description field, even though those details already exist in inputSchema. This created a problem: when ToolTransform hides a parameter (removing it from inputSchema), the stale reference in the description remained, confusing LLMs with a parameter they couldn't actually use.

The fix removes format_simple_description entirely — it was duplicating information that inputSchema already carries. Parameter descriptions, types, and required flags all live in inputSchema, which is also where transforms operate, so hiding a parameter now naturally removes all traces of it.

mcp = FastMCP.from_openapi(openapi_spec=spec, client=http_client)

# Before: description = "Get user\n\n**Path Parameters:**\n- **version**: API version"
# After:  description = "Get user"
# inputSchema always had: {"version": {"type": "string", "description": "API version"}}

Fixes #3130

jlowin and others added 2 commits February 11, 2026 11:26
Parameter details (name, description, type) already live in inputSchema
where transforms can control their visibility. Duplicating path params
into the prose description caused hidden params to leak through after
ToolTransform hid them from the schema.

Fixes #3130
@marvin-context-protocol marvin-context-protocol Bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. openapi Related to OpenAPI integration, parsing, or code generation features. tests labels Feb 11, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 275c4a1fb8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 20 to 22
format_deep_object_parameter,
format_description_with_responses,
format_json_for_description,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep format_simple_description importable for compatibility

Removing format_simple_description from the public OpenAPI utilities API introduces a backwards-incompatible runtime break: existing integrations that do from fastmcp.utilities.openapi import format_simple_description (or import it from ...openapi.formatters) will now fail with ImportError immediately after upgrade. Even if provider code no longer uses it, this symbol was previously exported and documented, so it should remain as a deprecated shim to avoid breaking downstream code unexpectedly.

Useful? React with 👍 / 👎.

@jlowin jlowin merged commit 0f95ed7 into main Feb 11, 2026
16 checks passed
@jlowin jlowin deleted the fix/openapi-path-param-description branch February 11, 2026 16:34
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 11, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request removes the format_simple_description function from the public API and modifies how OpenAPI tool descriptions are constructed. The function, which previously appended parameter and request body details to base descriptions, is deleted from the formatters module and its imports across the codebase. Tool descriptions in the OpenAPI provider now use base descriptions directly. Documentation is updated with anchor references and notes regarding fallback behaviors in background task contexts.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/openapi-path-param-description

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. openapi Related to OpenAPI integration, parsing, or code generation features. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hidden path parameters remain in the tool description

1 participant