mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 07:09:11 +02:00
Add docs-broken-links command and fix docstring markdown parsing (#2830)
This commit is contained in:
parent
3163e61ee4
commit
3e46b8cb4a
3 changed files with 14 additions and 12 deletions
4
justfile
4
justfile
|
|
@ -14,6 +14,10 @@ typecheck:
|
|||
docs:
|
||||
cd docs && npx --yes mint@latest dev
|
||||
|
||||
# Check for broken links in documentation
|
||||
docs-broken-links:
|
||||
cd docs && npx --yes mint@latest install && npx --yes mint@latest broken-links
|
||||
|
||||
# Generate API reference documentation for all modules
|
||||
api-ref-all:
|
||||
uvx --with-editable . --refresh-package mdxify mdxify@latest --all --root-module fastmcp --anchor-name "Python SDK" --exclude fastmcp.contrib
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class ElicitationJsonSchema(GenerateJsonSchema):
|
|||
def enum_schema(self, schema: core_schema.EnumSchema) -> JsonSchemaValue:
|
||||
"""Generate inline enum schema.
|
||||
|
||||
Always generates enum pattern: {"enum": [value, ...]}
|
||||
Always generates enum pattern: `{"enum": [value, ...]}`
|
||||
Titled enums are handled separately via dict-based syntax in ctx.elicit().
|
||||
"""
|
||||
# Get the base schema from parent - always use simple enum pattern
|
||||
|
|
@ -134,12 +134,12 @@ def parse_elicit_response_type(response_type: Any) -> ElicitConfig:
|
|||
|
||||
Supports multiple syntaxes:
|
||||
- None: Empty object schema, expect empty response
|
||||
- dict: {"low": {"title": "..."}} -> single-select titled enum
|
||||
- dict: `{"low": {"title": "..."}}` -> single-select titled enum
|
||||
- list patterns:
|
||||
- [["a", "b"]] -> multi-select untitled
|
||||
- [{"low": {...}}] -> multi-select titled
|
||||
- ["a", "b"] -> single-select untitled
|
||||
- list[X] type annotation: multi-select with type
|
||||
- `[["a", "b"]]` -> multi-select untitled
|
||||
- `[{"low": {...}}]` -> multi-select titled
|
||||
- `["a", "b"]` -> single-select untitled
|
||||
- `list[X]` type annotation: multi-select with type
|
||||
- Scalar types (bool, int, float, str, Literal, Enum): single value
|
||||
- Other types (dataclass, BaseModel): use directly
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""Task key management for SEP-1686 background tasks.
|
||||
|
||||
Task keys encode security scoping and metadata in the Docket key format:
|
||||
{session_id}:{client_task_id}:{task_type}:{component_identifier}
|
||||
`{session_id}:{client_task_id}:{task_type}:{component_identifier}`
|
||||
|
||||
This format provides:
|
||||
- Session-based security scoping (prevents cross-session access)
|
||||
|
|
@ -20,7 +20,7 @@ def build_task_key(
|
|||
) -> str:
|
||||
"""Build Docket task key with embedded metadata.
|
||||
|
||||
Format: {session_id}:{client_task_id}:{task_type}:{component_identifier}
|
||||
Format: `{session_id}:{client_task_id}:{task_type}:{component_identifier}`
|
||||
|
||||
The component_identifier is URI-encoded to handle special characters (colons, slashes, etc.).
|
||||
|
||||
|
|
@ -55,12 +55,10 @@ def parse_task_key(task_key: str) -> dict[str, str]:
|
|||
|
||||
Examples:
|
||||
>>> parse_task_key("session123:task456:tool:my_tool")
|
||||
{'session_id': 'session123', 'client_task_id': 'task456',
|
||||
'task_type': 'tool', 'component_identifier': 'my_tool'}
|
||||
`{'session_id': 'session123', 'client_task_id': 'task456', 'task_type': 'tool', 'component_identifier': 'my_tool'}`
|
||||
|
||||
>>> parse_task_key("session123:task456:resource:file%3A%2F%2Fdata.txt")
|
||||
{'session_id': 'session123', 'client_task_id': 'task456',
|
||||
'task_type': 'resource', 'component_identifier': 'file://data.txt'}
|
||||
`{'session_id': 'session123', 'client_task_id': 'task456', 'task_type': 'resource', 'component_identifier': 'file://data.txt'}`
|
||||
"""
|
||||
parts = task_key.split(":", 3)
|
||||
if len(parts) != 4:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue