Module types

Module types 

Source
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§

AudioContent
Audio content (base64 encoded).
CallToolRequest
Request parameters for calling a tool.
CallToolResult
The result of calling a tool.
CancelTaskRequest
Request parameters for cancelling a task.
CompleteRequest
Request for argument completion.
CompleteResult
Result of a completion request.
Completion
Completion result.
CompletionArgument
Argument for completion.
ContentAnnotations
Annotations that can be attached to content.
CreateMessageRequest
Request for creating a sampling message.
CreateMessageResult
Result of a sampling request.
ElicitRequest
A request to elicit information from the user.
ElicitResult
Result of an elicitation request.
ElicitationSchema
Schema for elicitation input.
GetPromptRequest
Request parameters for getting a prompt.
GetPromptResult
The result of getting a prompt.
GetTaskRequest
Request parameters for getting a task.
ImageContent
Image content (base64 encoded).
ListPromptsRequest
Request parameters for listing prompts.
ListPromptsResult
Response for listing prompts.
ListResourceTemplatesResult
Response for listing resource templates.
ListResourcesRequest
Request parameters for listing resources.
ListResourcesResult
Response for listing resources.
ListTasksRequest
Request parameters for listing tasks.
ListTasksResult
Response for listing tasks.
ListToolsRequest
Request parameters for listing tools.
ListToolsResult
Response for listing tools.
ModelHint
A hint for model selection.
ModelPreferences
Model preferences for sampling.
Prompt
A prompt definition exposed by an MCP server.
PromptArgument
An argument that a prompt accepts.
PromptListChangedNotification
Notification that the prompt list has changed.
PromptMessage
A message in a prompt result.
PropertySchema
Schema for a single property in an elicitation.
ReadResourceRequest
Request parameters for reading a resource.
ReadResourceResult
Response for reading a resource.
Resource
A resource exposed by an MCP server.
ResourceAnnotations
Annotations for resources.
ResourceContent
Embedded resource content.
ResourceContents
The contents of a resource.
ResourceListChangedNotification
Notification that the resource list has changed.
ResourceTemplate
A template for dynamic resource URIs.
ResourceUpdatedNotification
Notification that a resource has changed.
SamplingMessage
A message in a sampling conversation.
Task
Full state information for a task.
TaskError
Error information for a failed task.
TaskId
Unique identifier for a task.
TaskProgress
Progress information for a running task.
TaskStatusNotification
Notification that a task’s status has changed.
TaskSummary
A summary of a task (for listing).
TextContent
Text content.
Tool
A tool definition exposed by an MCP server.
ToolAnnotations
Annotations providing hints about tool behavior.

Enums§

CompletionRef
Reference to a prompt or resource for completion context.
CompletionTotal
Total completion count.
Content
Content that can be included in messages and results.
ElicitAction
The action taken in response to an elicitation.
IncludeContext
What context to include in sampling.
PromptOutput
Simplified output type for prompt handlers.
Role
The role of a message participant.
StopReason
Reason why sampling stopped.
TaskStatus
The current status of a task.
ToolOutput
A simplified tool output type for handler implementations.