Skip to content

feat: Allow Toolset-specific instructions to be added to server instructions#757

Open
saswatamcode wants to merge 3 commits intocontainers:mainfrom
saswatamcode:toolsetins
Open

feat: Allow Toolset-specific instructions to be added to server instructions#757
saswatamcode wants to merge 3 commits intocontainers:mainfrom
saswatamcode:toolsetins

Conversation

@saswatamcode
Copy link
Copy Markdown

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.

pkg/mcp/mcp.go Outdated

for _, toolset := range toolsets {
if toolsetInstructions := toolset.GetToolsetInstructions(); toolsetInstructions != "" {
instructions = append(instructions, toolsetInstructions)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I wonder if there should be a separation between the toolsets instructions? Something like

# toolset1_name
toolset1_instructions

# toolset2_name
toolset2_instructions

or similar?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Was assuming we'd leave it to the toolsets themselves

Copy link
Copy Markdown
Collaborator

@Cali0707 Cali0707 Feb 10, 2026

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Author

@saswatamcode saswatamcode Feb 11, 2026

Choose a reason for hiding this comment

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

Added here a8a5807


// 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"`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we want this to be always on? (e.g. disabled:false) ?

Copy link
Copy Markdown
Author

@saswatamcode saswatamcode Feb 10, 2026

Choose a reason for hiding this comment

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

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

@manusa manusa self-requested a review February 10, 2026 14:35
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants