mcptools icon indicating copy to clipboard operation
mcptools copied to clipboard

Tool title field not supported (MCP spec 2025-06-18)

Open mrcanofcatfood opened this issue 6 months ago • 0 comments

Problem

The MCP spec (2025-06-18) defines an optional title field on tool definitions — a human-readable display name separate from the name identifier.

tool_as_json() only serializes name, description, and inputSchema. The title field is omitted.

Why This Matters

  • name is a programmatic identifier (e.g., "query_occurrences_ala")
  • title is a human-readable display name (e.g., "Query ALA Occurrences")
  • description is the detailed explanation for the LLM

Clients use title in UI elements like tool pickers and confirmation dialogs. Without it, clients fall back to showing name (ugly) or description (verbose).

Expected

ellmer::tool(
  fun = function() "...",
  name = "query_occurrences_ala",
  title = "Query ALA Occurrences",
  description = "Search the Atlas of Living Australia for species occurrence records"
)

Should produce:

{
  "name": "query_occurrences_ala",
  "title": "Query ALA Occurrences",
  "description": "Search the Atlas of Living Australia...",
  "inputSchema": {...}
}

Fix

  1. Add title parameter to ellmer::tool() (stores on ToolDef)
  2. Include in tool_as_json() output when present

Lower priority than #103 and #104 but straightforward to implement alongside them.

mrcanofcatfood avatar May 20 '26 12:05 mrcanofcatfood