| Crates.io | turbomcp-types |
| lib.rs | turbomcp-types |
| version | 3.0.0-beta.3 |
| created_at | 2026-01-19 01:03:14.243914+00 |
| updated_at | 2026-01-22 15:58:40.016019+00 |
| description | Core types for TurboMCP - the foundation of the MCP SDK |
| homepage | https://turbomcp.org |
| repository | https://github.com/Epistates/turbomcp |
| max_upload_size | |
| id | 2053415 |
| size | 63,485 |
Core types for the TurboMCP SDK - the foundation of MCP server development.
This crate provides all shared types used across the TurboMCP ecosystem:
Content, TextContent, ImageContent, etc.ToolResult, ResourceResult, PromptResultTool, Resource, Prompt, ServerInfoIntoToolResult, IntoResourceResult, IntoPromptResultFor error handling, use turbomcp_core::error::{McpError, McpResult}.
std (default): Enable standard library supportalloc: Allocator support without full std (for no_std + alloc environments)schema: JSON Schema generation for tool input schemasuse turbomcp_types::*;
// Create a tool result
let result = ToolResult::text("Hello, world!");
// Create an error result
let error = ToolResult::error("Something went wrong");
// Create a JSON result with structured content
let json_result = ToolResult::json(&serde_json::json!({"key": "value"})).unwrap();
// Create a resource result
let resource = ResourceResult::text("file:///example.txt", "File contents here");
// Create a prompt result
let prompt = PromptResult::user("Hello!")
.add_assistant("How can I help?")
.with_description("A greeting prompt");
[dependencies]
turbomcp-types = { version = "3.0", default-features = false, features = ["alloc"] }
MIT