From 6b8a62c127076c8e42e7e3c39ac8bee2e6e656f3 Mon Sep 17 00:00:00 2001
From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
Date: Mon, 28 Jul 2025 17:49:32 -0400
Subject: [PATCH] Add client docs
---
docs/clients/prompts.mdx | 25 +++++++++++++++++++++++++
docs/clients/resources.mdx | 28 ++++++++++++++++++++++++++++
docs/clients/tools.mdx | 25 +++++++++++++++++++++++++
3 files changed, 78 insertions(+)
diff --git a/docs/clients/prompts.mdx b/docs/clients/prompts.mdx
index 0ba4d2765..ea5ee5604 100644
--- a/docs/clients/prompts.mdx
+++ b/docs/clients/prompts.mdx
@@ -25,8 +25,33 @@ async with client:
print(f"Description: {prompt.description}")
if prompt.arguments:
print(f"Arguments: {[arg.name for arg in prompt.arguments]}")
+ # Access tags and other metadata
+ if hasattr(prompt, '_meta') and prompt._meta:
+ print(f"Tags: {prompt._meta.get('tags', [])}")
```
+### Filtering by Tags
+
+You can use the `meta` field to filter prompts based on their tags:
+
+```python
+async with client:
+ prompts = await client.list_prompts()
+
+ # Filter prompts by tag
+ analysis_prompts = [
+ prompt for prompt in prompts
+ if hasattr(prompt, '_meta') and prompt._meta and
+ 'analysis' in prompt._meta.get('tags', [])
+ ]
+
+ print(f"Found {len(analysis_prompts)} analysis prompts")
+```
+
+
+The `_meta` field is part of the standard MCP specification, but the inclusion of tags within it is specific to FastMCP servers. Other MCP server implementations may not provide tags in their metadata.
+
+
## Using Prompts
### Basic Usage
diff --git a/docs/clients/resources.mdx b/docs/clients/resources.mdx
index ecad582e0..a8686e184 100644
--- a/docs/clients/resources.mdx
+++ b/docs/clients/resources.mdx
@@ -34,6 +34,9 @@ async with client:
print(f"Name: {resource.name}")
print(f"Description: {resource.description}")
print(f"MIME Type: {resource.mimeType}")
+ # Access tags and other metadata
+ if hasattr(resource, '_meta') and resource._meta:
+ print(f"Tags: {resource._meta.get('tags', [])}")
```
### Resource Templates
@@ -49,8 +52,33 @@ async with client:
print(f"Template URI: {template.uriTemplate}")
print(f"Name: {template.name}")
print(f"Description: {template.description}")
+ # Access tags and other metadata
+ if hasattr(template, '_meta') and template._meta:
+ print(f"Tags: {template._meta.get('tags', [])}")
```
+### Filtering by Tags
+
+You can use the `meta` field to filter resources based on their tags:
+
+```python
+async with client:
+ resources = await client.list_resources()
+
+ # Filter resources by tag
+ config_resources = [
+ resource for resource in resources
+ if hasattr(resource, '_meta') and resource._meta and
+ 'config' in resource._meta.get('tags', [])
+ ]
+
+ print(f"Found {len(config_resources)} config resources")
+```
+
+
+The `_meta` field is part of the standard MCP specification, but the inclusion of tags within it is specific to FastMCP servers. Other MCP server implementations may not provide tags in their metadata.
+
+
## Reading Resources
### Static Resources
diff --git a/docs/clients/tools.mdx b/docs/clients/tools.mdx
index 68d4424bc..ed6b9d390 100644
--- a/docs/clients/tools.mdx
+++ b/docs/clients/tools.mdx
@@ -25,8 +25,33 @@ async with client:
print(f"Description: {tool.description}")
if tool.inputSchema:
print(f"Parameters: {tool.inputSchema}")
+ # Access tags and other metadata
+ if hasattr(tool, '_meta') and tool._meta:
+ print(f"Tags: {tool._meta.get('tags', [])}")
```
+### Filtering by Tags
+
+You can use the `meta` field to filter tools based on their tags:
+
+```python
+async with client:
+ tools = await client.list_tools()
+
+ # Filter tools by tag
+ analysis_tools = [
+ tool for tool in tools
+ if hasattr(tool, '_meta') and tool._meta and
+ 'analysis' in tool._meta.get('tags', [])
+ ]
+
+ print(f"Found {len(analysis_tools)} analysis tools")
+```
+
+
+The `_meta` field is part of the standard MCP specification, but the inclusion of tags within it is specific to FastMCP servers. Other MCP server implementations may not provide tags in their metadata.
+
+
## Executing Tools
### Basic Execution