FastMCP Service Get Tools Task¤
task api name:
get_tools
FastMCP service get_tools task returns the list of MCP tools generated by FastMCP worker.
Tools are created from NorFab service tasks and follow this naming convention:
service_<service_name>__task_<task_name>
Inputs¤
| Parameter | Required | Description |
|---|---|---|
brief |
No | Return tool names only. |
service |
No | Filter tools by NorFab service name. |
name |
No | Filter tools by glob pattern. |
workers |
No | FastMCP workers to target. Defaults to any worker. |
Output¤
The task returns MCP tool definitions. Detailed definitions include effective
task call guardrails and task result_guardrails when configured. These are
NorFab inspection fields and are not added to the MCP SDK Tool schema. With
brief=True, the task returns tool names only.
Examples¤
Example
List all tools:
nf# show fastmcp tools
List tools for a specific service (names only):
nf# show fastmcp tools service nornir brief
Filter tools by name using glob patterns:
nf# show fastmcp tools name "*cli" brief
Context manager - list Nornir tool names:
import pprint
from norfab.core.nfapi import NorFab
with NorFab(inventory="inventory.yaml") as nf:
client = nf.make_client()
result = client.run_job(
service="fastmcp",
task="get_tools",
kwargs={"brief": True, "service": "nornir"},
workers="any",
)
pprint.pprint(result)
Direct lifecycle - filter tools by name:
import pprint
from norfab.core.nfapi import NorFab
nf = NorFab(inventory="inventory.yaml")
try:
nf.start()
client = nf.make_client()
result = client.run_job(
service="fastmcp",
task="get_tools",
kwargs={"brief": True, "name": "*cli"},
workers="any",
)
pprint.pprint(result)
finally:
nf.destroy()
NORFAB FastMCP Get Tools Command Shell Reference¤
NorFab shell supports these command options for FastMCP get_tools task:
nf# man tree show.fastmcp.tools
root
└── show: NorFab show commands
└── fastmcp: Show FastMCP service
└── tools: show FastMCP server tools
├── brief: show tools names only
├── service: filter tools by service name
├── name: filter tools by name using glob pattern
├── workers: Filter worker to target, default 'any'
└── timeout: Job timeout
nf#
Python API Reference¤
Retrieve tools from the available norfab services, optionally filtered by service name and tool name pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
brief
|
bool
|
If True, returns a list of tool names. If False, returns a dictionary with tool details. |
False
|
service
|
str
|
The name of the service to filter tools by. Use "all" to include all services. |
'all'
|
name
|
str
|
A glob pattern to match tool names. |
'*'
|
Returns:
| Name | Type | Description |
|---|---|---|
Result |
Result
|
An object containing the filtered tools. If brief is True, result is a list of tool names. Otherwise, result is a dictionary mapping tool names to their details. |
Source code in norfab\workers\fastmcp_worker\fastmcp_worker.py
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 | |