mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-10-22 21:01:26 +02:00
`dereference_refs` inlines local `$ref` pointers when tools and resource templates are listed (`dereference_schemas=True`). Inlining is a good default for ordinary schemas, but some definition graphs are far larger once fully expanded than they are as written. For those, keeping `$defs` is the better result for clients and for the server. `dereference_refs` now measures the expanded size before inlining, checks the structure `jsonref` builds, and checks the final text size. Schemas that would exceed 100,000 nodes, 128 levels or about 5 million characters use the existing behavior for circular schemas: the root `$ref` is resolved, and `$defs` and nested `$ref` pointers are kept. Sibling keywords are now merged from the definition each pointer resolves to. Typical Pydantic and MCP schemas are well under these limits; the largest MCP protocol model schema measures about 25,000 nodes. Co-authored-by: Bill Easton <williamseaston@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| json_schema_type | ||
| openapi | ||
| __init__.py | ||
| httpx2_mock.py | ||
| test_asgi_transport.py | ||
| test_async_utils.py | ||
| test_auth.py | ||
| test_cli.py | ||
| test_components.py | ||
| test_docstring_parsing.py | ||
| test_http.py | ||
| test_inspect.py | ||
| test_inspect_icons.py | ||
| test_json_schema.py | ||
| test_json_schema_expansion.py | ||
| test_logging.py | ||
| test_skills.py | ||
| test_tests.py | ||
| test_timeout.py | ||
| test_token_cache.py | ||
| test_typeadapter.py | ||
| test_types.py | ||
| test_version_check.py | ||