Skip to main content
FastMCP exports TypeScript type definitions for tools, resources, prompts, and server configuration.

Tool Types

Tool

Tool definition with execute function.

ToolAnnotations

Tool behavior hints (MCP Specification 2025-03-26).

Resource Types

Resource

Static resource definition.

ResourceTemplate

Dynamic resource with URI template.

ResourceResult

Resource content result.

ResourceTemplateArgument

Resource template parameter definition.

Prompt Types

Prompt

Prompt template definition.

PromptArgument

Prompt parameter definition.

PromptResult

Prompt load result.

Content Types

Content

Union of all content types.

TextContent

Plain text content.

ImageContent

Image content with base64 data.

AudioContent

Audio content with base64 data.

ResourceContent

Embedded resource reference.
Reference to external resource.

ContentResult

Tool execution result with content array.

Server Types

FastMCPSessionAuth

Base type for session authentication.

Context

Execution context passed to tool/resource/prompt functions.

Progress

Progress reporting data.

Logger

Logging interface.

FastMCPRequest

Enhanced request object for custom routes.

FastMCPResponse

Enhanced response object for custom routes.

HTTPMethod

HTTP methods for custom routes.

RouteHandler

Route handler function type.

RouteOptions

Options for custom routes.

Completion Types

Completion

Completion result for argument values.

ArgumentValueCompleter

Completion function for argument values.

Error Types

UserError

Error meant to be surfaced to the user.

UnexpectedStateError

Internal error for unexpected states.

Utility Types

SerializableValue

JSON-serializable value.

ToolParameters

Tool parameter schema (Standard Schema v1).