Skip to content

Conversation

@parente
Copy link

@parente parente commented Dec 8, 2025

Describe your changes

This PR implements the solution proposed in #252: specifying MCP tool annotations using an x-mcp-annotations OpenAPI extension via a route decorator.

Issue ticket number and link (if applicable)

#252

Screenshots of the feature / bugfix

@app.get(
        "/items/",
        response_model=List[Item],
        tags=["items"],
        operation_id="list_items",
        openapi_extra={
            "x-mcp-annotations": {
                "readOnlyHint": True,
                "openWorldHint": False,
            }
        },
    )
    async def list_items(...): ...

Checklist before requesting a review

  • Added relevant tests
  • Run ruff & mypy
  • All tests pass

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant