Skip to content

Conversation

@mochow13
Copy link
Contributor

Implements #3353

async def main():
async with agent:
# Access server instructions after connection is established
if server.instructions:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update the example to show those these instructions would be used in the agent instructions, using a dynamic instructions function:

@agent.instructions
async def mcp_server_instructions():
    return server.instructions

When that's called, I believe the server connection is guaranteed to have been established.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants