@@ -7,7 +7,7 @@ sidebarTitle: components
77
88## Functions
99
10- ### ` get_fastmcp_metadata ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L26 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
10+ ### ` get_fastmcp_metadata ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L22 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
1111
1212``` python
1313get_fastmcp_metadata(meta: dict[str , Any] | None ) -> FastMCPMeta
@@ -22,9 +22,9 @@ namespace for compatibility with older FastMCP servers.
2222
2323## Classes
2424
25- ### ` FastMCPMeta ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L20 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
25+ ### ` FastMCPMeta ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L16 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
2626
27- ### ` FastMCPComponent ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L74 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
27+ ### ` FastMCPComponent ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L70 " target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
2828
2929
3030Base class for FastMCP tools, prompts, resources, and resource templates.
@@ -114,58 +114,7 @@ copy(self) -> Self
114114Create a copy of the component.
115115
116116
117- #### ` register_with_docket ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L227" target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
118-
119- ``` python
120- register_with_docket(self , docket: Docket) -> None
121- ```
122-
123- Register this component with docket for background execution.
124-
125- No-ops if task_config.mode is "forbidden". Subclasses override to
126- register their callable (self.run, self.read, self.render, or self.fn).
127-
128-
129- #### ` coerce_task_arguments ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L235" target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
130-
131- ``` python
132- coerce_task_arguments(self , arguments: dict[str , Any]) -> dict[str , Any]
133- ```
134-
135- Validate and coerce task arguments before any task state is created.
136-
137- Called by `` submit_to_docket `` up front, so invalid inputs raise before
138- the task's Redis metadata and initial status notification exist —
139- otherwise a coercion failure during queueing would orphan a task the
140- client has already observed. The base implementation is a no-op;
141- components that splat arguments into a typed Python callable (e.g.
142- `` FunctionTool `` ) override this to mirror the synchronous validation
143- path.
144-
145- When `` strict `` is set (server-level `` strict_input_validation `` ),
146- overrides validate in strict mode so the task path rejects lax
147- coercions (e.g. the string `` "1" `` into an `` int `` ) exactly as the
148- synchronous call path does.
149-
150-
151- #### ` add_to_docket ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L255" target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
152-
153- ``` python
154- add_to_docket(self , docket: Docket, * args: Any, ** kwargs: Any) -> Execution
155- ```
156-
157- Schedule this component for background execution via docket.
158-
159- Subclasses override this to handle their specific calling conventions:
160- - Tool: add_to_docket(docket, arguments: dict, ** kwargs)
161- - Resource: add_to_docket(docket, ** kwargs)
162- - ResourceTemplate: add_to_docket(docket, params: dict, ** kwargs)
163- - Prompt: add_to_docket(docket, arguments: dict | None, ** kwargs)
164-
165- The ** kwargs are passed through to docket.add() (e.g., key=task_key).
166-
167-
168- #### ` get_span_attributes ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L277" target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
117+ #### ` get_span_attributes ` <sup ><a href = " https://github.com/PrefectHQ/fastmcp/blob/main/fastmcp_slim/fastmcp/utilities/components.py#L227" target = " _blank" ><Icon icon = " github" style = " width: 14px; height: 14px;" /></a ></sup >
169118
170119``` python
171120get_span_attributes(self ) -> dict[str , Any]
0 commit comments