We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea9a6c3 commit 8d4b41fCopy full SHA for 8d4b41f
docs/mcp/client.md
@@ -349,11 +349,13 @@ from pydantic_ai.mcp import MCPServerStreamableHTTP
349
server = MCPServerStreamableHTTP('http://localhost:8000/mcp')
350
agent = Agent('openai:gpt-5', toolsets=[server])
351
352
+@agent.instructions
353
+async def mcp_server_instructions():
354
+ return server.instructions
355
+
356
async def main():
- async with agent:
- # Access server instructions after connection is established
- if server.instructions:
- print(f'Server guidance: {server.instructions}')
357
+ result = await agent.run('Use the server tools to help me')
358
+ print(result.output)
359
```
360
361
## Tool metadata
0 commit comments