/**
* MCP Tool Definitions
* Shared tool schemas for all server implementations
*/
import { Tool } from '@modelcontextprotocol/sdk/types.js';
export const SEQUENTIAL_THINKING_TOOL: Tool = {
name: 'sequential_thinking',
description: 'Facilitates a detailed, step-by-step thinking process for problem-solving and analysis. Break down complex problems into manageable steps, revise and refine thoughts as understanding deepens, and branch into alternative paths of reasoning.',
inputSchema: {
type: 'object',
properties: {
thought: {
type: 'string',
description: 'The current reasoning step or thought in the sequence',
},
nextThoughtNeeded: {
type: 'boolean',
description: 'Indicates whether additional reasoning steps are required after this one',
},
thoughtNumber: {
type: 'number',
description: 'The sequential number of this thought (e.g., 1, 2, 3...)',
},
totalThoughts: {
type: 'number',
description: 'Estimated total number of thoughts needed to complete the reasoning',
},
isRevision: {
type: 'boolean',
description: 'Marks this thought as a reconsideration or refinement of a previous step',
},
revisesThought: {
type: 'number',
description: 'The thought number being revised (required if isRevision is true)',
},
branchFromThought: {
type: 'number',
description: 'The thought number from which this alternative reasoning path branches',
},
branchId: {
type: 'string',
description: 'Unique identifier for this alternative reasoning branch',
},
needsMoreThoughts: {
type: 'boolean',
description: 'Signals that the total number of thoughts needs to be expanded',
},
},
required: ['thought', 'nextThoughtNeeded', 'thoughtNumber', 'totalThoughts'],
},
};
export const GET_SEQUENCE_TOOL: Tool = {
name: 'get_thought_sequence',
description: 'Retrieves the complete sequence of thoughts for the current or specified session',
inputSchema: {
type: 'object',
properties: {
sessionId: {
type: 'string',
description: 'Optional session ID to retrieve (defaults to current session)',
},
},
},
};
export const GET_BRANCH_TOOL: Tool = {
name: 'get_thought_branch',
description: 'Retrieves a specific branch of alternative reasoning paths',
inputSchema: {
type: 'object',
properties: {
branchId: {
type: 'string',
description: 'The identifier of the branch to retrieve',
},
sessionId: {
type: 'string',
description: 'Optional session ID (defaults to current session)',
},
},
required: ['branchId'],
},
};
export const RESET_SESSION_TOOL: Tool = {
name: 'reset_thinking_session',
description: 'Starts a new thinking session, clearing the current thought sequence',
inputSchema: {
type: 'object',
properties: {},
},
};
export const GET_SESSION_SUMMARY_TOOL: Tool = {
name: 'get_session_summary',
description: 'Gets a summary of the current or specified thinking session',
inputSchema: {
type: 'object',
properties: {
sessionId: {
type: 'string',
description: 'Optional session ID (defaults to current session)',
},
},
},
};
export const ALL_TOOLS: Tool[] = [
SEQUENTIAL_THINKING_TOOL,
GET_SEQUENCE_TOOL,
GET_BRANCH_TOOL,
RESET_SESSION_TOOL,
GET_SESSION_SUMMARY_TOOL,
];