Schema
schema
IntrospectableFn
Bases: Protocol
Structural protocol for any callable that supports inspect.signature.
Source code in packages/axm-mcp/src/axm_mcp/schema.py
apply_signature(wrapper, exec_fn, override_module)
Set the typed __signature__ so FastMCP builds the right schema.
Source code in packages/axm-mcp/src/axm_mcp/schema.py
collect_dispatcher_params(fn, *, override_module=None)
Collect union of typed params from dispatcher sub-functions.
A dispatcher is a function with action: str + **kwargs
that routes to sub-functions stored in a module-level _*_ACTIONS
dict. This helper introspects all sub-functions and returns the
union of their parameters (all made optional).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fn
|
IntrospectableFn
|
The dispatcher function to introspect. |
required |
override_module
|
ModuleType | None
|
Module to search for |
None
|
Returns:
| Type | Description |
|---|---|
list[Parameter] | None
|
List of |
Source code in packages/axm-mcp/src/axm_mcp/schema.py
extract_docstring_params(docstring)
Parse Google-style Args: section into inspect.Parameter objects.
This is the fallback for non-dispatcher tools whose execute(**kwargs)
has no typed parameters in the signature but documents them in the
docstring.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
docstring
|
str | None
|
The docstring to parse. |
required |
Returns:
| Type | Description |
|---|---|
list[Parameter]
|
List of keyword-only |
list[Parameter]
|
Empty list if no |
Source code in packages/axm-mcp/src/axm_mcp/schema.py
signature_params(exec_fn)
Strip self / **kwargs from exec_fn, falling back to its docstring.