Quick Start
1
Read a resource
An agent connects to a resource server and reads a file — no extra setup.
list_mcp_resources and read_mcp_resource were auto-registered because the server advertises resources.2
Run a prompt
Servers that ship prompt templates expose
list_mcp_prompts and get_mcp_prompt.3
Namespace with a prefix (optional)
Add a per-server prefix when combining multiple servers on one agent.
How It Works
Resources and prompts are looked up during connect, then routed through synthetic tools the agent can call. Synthetic tools are capability-gated — they only appear when the server advertises them.
Resources are looked up during connect via
list_resources(), list_resource_templates(), and list_prompts(). Each is a best-effort call — tools-only servers still initialise cleanly.
User interaction flow
A real run stitches the synthetic tools together automatically.User: “What’s the tallest mountain?” Agent →list_mcp_resources()(findsdocs://mountains.md) →read_mcp_resource("docs://mountains.md")→ composes the final answer.
Configuration Options
No config class is required — behaviour is capability-gated automatically. Two knobs let you shape what the agent sees.Introspection API
Inspect capability without invoking any tool.MCP.get_resources() returns resource and resource-template dicts:
MCP.get_prompts() returns prompt dicts with argument hints:
Payload guard
Content is normalised before it reaches the agent, capped byMAX_INLINE_BYTES = 100_000.
- Text over the limit is truncated with a
...[truncated, N chars total]marker. - Binary payloads never inline — they become
[binary resource: <mimeType>, <N> bytes].
Common Patterns
Combine tools + resources on one agent. A research server offering both asearch tool and a corpus of resources feeds one agent — the tool searches, the resources get read.
Best Practices
Prefer smaller resources
Prefer smaller resources
Servers that expose very large files hand agents truncated content once past
MAX_INLINE_BYTES = 100_000. Split resources or add a search tool so the agent fetches only what it needs.Use with_tool_prefix when combining servers
Use with_tool_prefix when combining servers
Two servers advertising
read_mcp_resource otherwise show up with the same name and confuse the model. Prefix each server so names stay distinct.Filter with disabled_tools for tighter agents
Filter with disabled_tools for tighter agents
If an agent shouldn’t browse prompt packs, drop
list_mcp_prompts explicitly via disabled_tools. Synthetic tools go through the same filters as server tools.A server tool of the same name always wins
A server tool of the same name always wins
If the server registers a real
read_mcp_resource, the synthetic version is skipped by design so the callable and its schema stay consistent. Don’t rely on the synthetic tool when the server exposes its own.Related
MCP Tools
MCP module basics and tool usage
MCP Transports
How PraisonAI connects to MCP servers

