Closed
Description
Please read this first
- Have you read the docs?Agents SDK docsHave you searched for related issues? Others may have had similar requests
Question
MCP Servers define instructions, for example the aws-documentation-mcp-server.
Instructions are currently ignored in the Agent execution flow. It only reads mcp tools and converts these to LLM tool descriptions. Is this an explicit design decision?
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
rm-openai commentedon May 15, 2025
Not explicit, I didn't realize this existed. From the docs, looks like instructions is optional and it says
We could add a way for you to fetch the instructions, and then you can choose to append that to the system prompt. Open to other ideas too.
bocytko commentedon May 15, 2025
This sounds intuitive enough to me. Shall I file a separate feature request?
rm-openai commentedon May 15, 2025
Nope, we can use this issue. PR also welcome!
DanieleMorotti commentedon May 16, 2025
Hi @bocytko, if you haven’t started on this yet I’d be happy to implement this feature.
I found that the
instructions
are included in theinstructions
field of the session‐initialization response. We could store it on the server and inject them into the prompt where needed.bocytko commentedon May 16, 2025
@DanieleMorotti please go ahead. Thank you in advance!
DanieleMorotti commentedon May 16, 2025
@rm-openai I can do something like this:
in
src/agents/mcp/server.py
at line 125. But how / where to pass this variable only for the tools related to a specific server? In theFunctionTool
object?rm-openai commentedon May 16, 2025
@DanieleMorotti wdym? I don't think you need to do anything else. Once you do that, users will be able to do this:
DanieleMorotti commentedon May 16, 2025
Ok sorry, I thought it should be injected to the prompt somehow but instead users will directly choose how to adopt instructions.
rm-openai commentedon May 16, 2025
Ah yup, prefer to leave it to users - less magic that way.
Added mcp 'instructions' attribute to the server (#706)
Added mcp 'instructions' attribute to the server (openai#706)