feat: Allow Toolset-specific instructions to be added to server instructions#757
feat: Allow Toolset-specific instructions to be added to server instructions#757saswatamcode wants to merge 3 commits intocontainers:mainfrom
Conversation
pkg/mcp/mcp.go
Outdated
|
|
||
| for _, toolset := range toolsets { | ||
| if toolsetInstructions := toolset.GetToolsetInstructions(); toolsetInstructions != "" { | ||
| instructions = append(instructions, toolsetInstructions) |
There was a problem hiding this comment.
I wonder if there should be a separation between the toolsets instructions? Something like
# toolset1_name
toolset1_instructions
# toolset2_name
toolset2_instructions
or similar?
There was a problem hiding this comment.
Was assuming we'd leave it to the toolsets themselves
There was a problem hiding this comment.
IMO it would probably be better to handle the separation logic in one place, so that we can keep all of it consistent between toolsets
There was a problem hiding this comment.
I'm separating by adding a newline here, essentially.
However, if we want to centralize the header-based separation in one place, I can add it in
|
|
||
| // DisableToolsetInstructions indicates whether toolset instructions are to be excluded | ||
| // from being provided by the MCP server to the MCP client in the initialize response. | ||
| DisableToolsetInstructions bool `toml:"disable_toolset_instructions,omitempty"` |
There was a problem hiding this comment.
do we want this to be always on? (e.g. disabled:false) ?
There was a problem hiding this comment.
My thinking was that the toolsets in this repo would be "trusted", and reviewed, so the instructions could safely always be passed in, and optionally be disabled if the user would like to use something custom
…uctions This commit adds a new method GetToolsetInstructions to Toolset interface, to allow Toolsets to specify their own custom instructions (LLM-friendly text describing how tools within a particular toolset can be used in tandem). This is then bubbled up to MCP server initialize response and appended to the provided server prompt. Also added a config option to disable this behavior. Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
28b2d43 to
a8a5807
Compare
This commit adds a new method GetToolsetInstructions to Toolset interface, to allow Toolsets to specify their own custom instructions (LLM-friendly text describing how tools within a particular toolset can be used in tandem).
This is then bubbled up to MCP server initialize response and appended to the provided server prompt. Also added a config option to disable this behavior.