Skip to content

Commit 3e431fc

Browse files
committed
Add name and title fields to Tool class
These fields were missing from the Tool type definition.
1 parent 673423d commit 3e431fc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/mcp/types.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,19 @@ class ToolAnnotations(BaseModel):
871871
class Tool(BaseMetadata):
872872
"""Definition for a tool the client can call."""
873873

874+
name: str
875+
"""
876+
Intended for programmatic or logical use, but used as a display name
877+
in past specs or fallback (if title isn’t present).
878+
"""
879+
title: str | None = None
880+
"""
881+
Intended for UI and end-user contexts — optimized to be human-readable
882+
and easily understood, even by those unfamiliar with domain-specific terminology.
883+
884+
If not provided, the name should be used for display
885+
(except for Tool, where annotations.title should be given precedence over using name, if present).
886+
"""
874887
description: str | None = None
875888
"""A human-readable description of the tool."""
876889
inputSchema: dict[str, Any]

0 commit comments

Comments
 (0)