Skip to content

MCP: refactor tool names to verb_resource templates and {docs} placeholders#2814

Open
reakaleek wants to merge 3 commits intomainfrom
feature/mcp-tool-naming-refactor
Open

MCP: refactor tool names to verb_resource templates and {docs} placeholders#2814
reakaleek wants to merge 3 commits intomainfrom
feature/mcp-tool-naming-refactor

Conversation

@reakaleek
Copy link
Member

@reakaleek reakaleek commented Mar 1, 2026

What

  • Add explicit tool name templates via [McpToolName] instead of prefix-based naming
  • Replace {docs} in tool descriptions with the profile's DocsDescription at registration time
  • Add ScopePrefix ("" for public, "internal_" for internal) and ResourceNoun ("docs", "internal_docs") for flexible tool name composition

Why

  • Tool names like search_docs and get_document_by_url are more readable than public_docs_semantic_search and public_docs_get_document_by_url
  • Descriptions adapt to the profile without hardcoding "Elastic" or "internal" in each tool
  • Aligns with the MCP server profiles work (MCP: add configurable server profiles (public, internal) #2813)

Tool name and description migration (public profile)

Previous New
public_docs_semantic_search — Searches all published Elastic documentation by meaning. Use when the user asks about Elastic product features, needs to find existing docs pages, verify published content, or research what documentation exists on a topic. Returns relevant documents with AI summaries, relevance scores, and navigation context. search_docs — Searches all published Elastic documentation by meaning. Use when the user asks about Elastic product features, needs to find existing docs pages, verify published content, or research what documentation exists on a topic. Returns relevant documents with AI summaries, relevance scores, and navigation context.
public_docs_find_related_docs — Finds Elastic documentation pages related to a given topic. Use when exploring what documentation exists around a subject, building context for writing, or discovering related content the user should be aware of. find_related_docs — Finds Elastic documentation pages related to a given topic. Use when exploring what documentation exists around a subject, building context for writing, or discovering related content the user should be aware of.
public_docs_get_document_by_url — Retrieves a specific Elastic documentation page by its URL. Use when the user provides an elastic.co/docs URL, references a known page, or you need the full content and metadata of a specific doc. Returns title, AI summaries, headings, navigation context, and optionally the full body. get_document_by_url — Retrieves a specific Elastic documentation page by its URL. Use when the user provides a documentation URL, references a known page, or you need the full content and metadata of a specific doc. Returns title, AI summaries, headings, navigation context, and optionally the full body.
public_docs_analyze_document_structure — Analyzes the structure of an Elastic documentation page. Use when evaluating page quality, checking heading hierarchy, or assessing AI enrichment status. Returns heading count, link count, parent pages, and whether AI summaries are present. analyze_document_structure — Analyzes the structure of an Elastic documentation page. Use when evaluating page quality, checking heading hierarchy, or assessing AI enrichment status. Returns heading count, link count, parent pages, and whether AI summaries are present.
public_docs_check_coherence — Checks how coherently a topic is covered across all Elastic documentation. Use when reviewing documentation quality, auditing coverage of a feature or concept, or checking whether a topic is documented consistently across products and sections. check_docs_coherence — Checks how coherently a topic is covered across all Elastic documentation. Use when reviewing documentation quality, auditing coverage of a feature or concept, or checking whether a topic is documented consistently across products and sections.
public_docs_find_inconsistencies — Finds potential inconsistencies across Elastic documentation pages covering the same topic. Use when auditing docs quality, verifying that instructions don't contradict each other, or checking for overlapping content within a product area. find_docs_inconsistencies — Finds potential inconsistencies across Elastic documentation pages covering the same topic. Use when auditing docs quality, verifying that instructions don't contradict each other, or checking for overlapping content within a product area.
public_docs_resolve_cross_link — Resolves an Elastic docs cross-link URI (e.g. 'docs-content://get-started/intro.md') to its published URL. Use when the user references a cross-link, needs to verify a link target, or wants to know what anchors are available on a page. resolve_cross_link(unchanged)
public_docs_list_repositories — Lists all Elastic documentation source repositories in the cross-link index. Use when the user needs to know which repositories publish documentation or wants to explore the docs ecosystem. list_repositories(unchanged)
public_docs_get_repository_links — Gets all pages and anchors published by a specific Elastic documentation repository. Use when exploring what a repository publishes, building a cross-link, or looking up available anchor targets. get_repository_links(unchanged)
public_docs_find_cross_links — Finds cross-links between Elastic documentation repositories. Use when analyzing inter-repository dependencies, checking what links into or out of a repository, or auditing cross-link usage. find_cross_links(unchanged)
public_docs_validate_cross_links — Validates cross-links targeting an Elastic documentation repository and reports broken ones. Use when checking link health, preparing a release, or diagnosing broken cross-references. validate_cross_links(unchanged)
public_docs_list_content_types — Lists all Elastic documentation content types (overview, how-to, tutorial, troubleshooting, changelog) with descriptions and guidance on when to use each. Use when deciding what type of page to create or when the user asks about Elastic docs structure. list_content_types(unchanged)
public_docs_generate_template — Generates a ready-to-use Elastic documentation template for a specific content type. Use when the user wants to create a new documentation page, needs a starting point with correct frontmatter and structure, or asks for a template. Returns Markdown (or YAML for changelogs). generate_template(unchanged)
public_docs_get_content_type_guidelines — Returns detailed authoring and evaluation guidelines for a specific Elastic documentation content type. Use when writing new content, reviewing existing pages against standards, or when the user asks about Elastic docs best practices. Includes required elements, recommended sections, and anti-patterns. get_content_type_guidelines(unchanged)

Internal profile (Search + Documents only):

Tool Name
SemanticSearch search_internal_docs
FindRelatedDocs find_related_internal_docs
GetDocumentByUrl get_internal_document_by_url
AnalyzeDocumentStructure analyze_internal_document_structure

Notes

  • Two placeholders: {resource} for the resource noun (e.g. search_{resource}search_docs) and {scope} for the scope prefix (e.g. get_{scope}document_by_urlget_internal_document_by_url)
  • Link and ContentType tools use static names; they are public-only

…aceholders

- Add McpToolNameAttribute for explicit tool name templates (e.g. search_{resource})
- Replace ToolNamePrefix with ResourceNoun in profiles (docs, internal_docs)
- Replace {docs} in tool descriptions with profile DocsDescription
- Update tool guidance to use {tool:name_{resource}} placeholders

Made-with: Cursor
…_url, analyze_document_structure)

Made-with: Cursor
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.

1 participant