Expand description
MCP-specific types for tools, resources, prompts, tasks, and content.
This module contains all the domain-specific types defined by the Model Context Protocol specification (version 2025-11-25).
§Overview
The MCP protocol defines several core capabilities:
- Tools: Callable functions that servers expose for AI assistants
- Resources: Data that servers expose (files, database entries, etc.)
- Prompts: Templated messages with arguments
- Tasks: Long-running operations with progress tracking
- Sampling: Requesting LLM completions from the client
- Elicitation: Requesting structured input from the user
- Content: Polymorphic content types (text, images, audio, resources)
Modules§
- completion
- Completion types for MCP argument completion.
- content
- Content types for MCP messages.
- elicitation
- Elicitation types for MCP servers.
- prompt
- Prompt types for MCP servers.
- resource
- Resource types for MCP servers.
- sampling
- Sampling types for MCP servers.
- task
- Task types for MCP servers.
- tool
- Tool types for MCP servers.
Structs§
- Audio
Content - Audio content (base64 encoded).
- Call
Tool Request - Request parameters for calling a tool.
- Call
Tool Result - The result of calling a tool.
- Cancel
Task Request - Request parameters for cancelling a task.
- Complete
Request - Request for argument completion.
- Complete
Result - Result of a completion request.
- Completion
- Completion result.
- Completion
Argument - Argument for completion.
- Content
Annotations - Annotations that can be attached to content.
- Create
Message Request - Request for creating a sampling message.
- Create
Message Result - Result of a sampling request.
- Elicit
Request - A request to elicit information from the user.
- Elicit
Result - Result of an elicitation request.
- Elicitation
Schema - Schema for elicitation input.
- GetPrompt
Request - Request parameters for getting a prompt.
- GetPrompt
Result - The result of getting a prompt.
- GetTask
Request - Request parameters for getting a task.
- Image
Content - Image content (base64 encoded).
- List
Prompts Request - Request parameters for listing prompts.
- List
Prompts Result - Response for listing prompts.
- List
Resource Templates Result - Response for listing resource templates.
- List
Resources Request - Request parameters for listing resources.
- List
Resources Result - Response for listing resources.
- List
Tasks Request - Request parameters for listing tasks.
- List
Tasks Result - Response for listing tasks.
- List
Tools Request - Request parameters for listing tools.
- List
Tools Result - Response for listing tools.
- Model
Hint - A hint for model selection.
- Model
Preferences - Model preferences for sampling.
- Prompt
- A prompt definition exposed by an MCP server.
- Prompt
Argument - An argument that a prompt accepts.
- Prompt
List Changed Notification - Notification that the prompt list has changed.
- Prompt
Message - A message in a prompt result.
- Property
Schema - Schema for a single property in an elicitation.
- Read
Resource Request - Request parameters for reading a resource.
- Read
Resource Result - Response for reading a resource.
- Resource
- A resource exposed by an MCP server.
- Resource
Annotations - Annotations for resources.
- Resource
Content - Embedded resource content.
- Resource
Contents - The contents of a resource.
- Resource
List Changed Notification - Notification that the resource list has changed.
- Resource
Template - A template for dynamic resource URIs.
- Resource
Updated Notification - Notification that a resource has changed.
- Sampling
Message - A message in a sampling conversation.
- Task
- Full state information for a task.
- Task
Error - Error information for a failed task.
- TaskId
- Unique identifier for a task.
- Task
Progress - Progress information for a running task.
- Task
Status Notification - Notification that a task’s status has changed.
- Task
Summary - A summary of a task (for listing).
- Text
Content - Text content.
- Tool
- A tool definition exposed by an MCP server.
- Tool
Annotations - Annotations providing hints about tool behavior.
Enums§
- Completion
Ref - Reference to a prompt or resource for completion context.
- Completion
Total - Total completion count.
- Content
- Content that can be included in messages and results.
- Elicit
Action - The action taken in response to an elicitation.
- Include
Context - What context to include in sampling.
- Prompt
Output - Simplified output type for prompt handlers.
- Role
- The role of a message participant.
- Stop
Reason - Reason why sampling stopped.
- Task
Status - The current status of a task.
- Tool
Output - A simplified tool output type for handler implementations.