Skip to content

Extend resource NameValidation beyond tools (sources, authServices, prompts)? #3681

Description

@he-yufeng

Background

#3654 added NameValidation (MCP v2025-11-25 tool-name rules) and the code comment above it says "we'll be implementing it across Toolbox", but as of main it is only wired into UnmarshalYAMLToolConfig (internal/server/config.go:387). Sources, authServices, prompts, and embeddingModels still accept any name.

Question

Which kinds should get the same validation, and is there a breaking-change window to respect?

  • Prompts seem the clearest next step: prompt names go over the MCP wire via prompts/list and prompts/get, the same protocol surface as tool names, so the spec's name rules arguably apply there too.
  • Sources / authServices are toolbox-internal references (a tool's source: field points at one). Names with spaces or commas currently parse fine, so tightening them would break existing configs that fix: add name validation to tools name #3654 deliberately left alone. If these should be validated too, a deprecation path might be needed rather than an outright rejection.

Happy to open a PR for whatever scope you prefer (prompts only, or prompts + sources with some compatibility story). Asking first since the right cut is a spec/policy call rather than a technical one.

Metadata

Metadata

Assignees

Labels

priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions