tools.tsā¢3.06 kB
/**
* JSON Schema property definition
*/
interface JSONSchemaProperty {
type: string;
description?: string;
items?: JSONSchemaProperty;
properties?: Record<string, JSONSchemaProperty>;
required?: string[];
}
/**
* Tool definition interface
*/
export interface ToolDefinition {
name: string;
description: string;
inputSchema: {
type: string;
properties: Record<string, JSONSchemaProperty>;
required?: string[];
};
}
/**
* MCP Tool definitions for clipboard operations
*/
export const TOOL_DEFINITIONS: ToolDefinition[] = [
{
name: 'copy_lines',
description: 'Copy lines from a file to session clipboard',
inputSchema: {
type: 'object',
properties: {
file_path: {
type: 'string',
description: 'Path to source file',
},
start_line: {
type: 'number',
description: 'Starting line number (1-indexed)',
},
end_line: {
type: 'number',
description: 'Ending line number (inclusive)',
},
},
required: ['file_path', 'start_line', 'end_line'],
},
},
{
name: 'cut_lines',
description: 'Cut lines from a file to session clipboard',
inputSchema: {
type: 'object',
properties: {
file_path: {
type: 'string',
description: 'Path to source file',
},
start_line: {
type: 'number',
description: 'Starting line number (1-indexed)',
},
end_line: {
type: 'number',
description: 'Ending line number (inclusive)',
},
},
required: ['file_path', 'start_line', 'end_line'],
},
},
{
name: 'paste_lines',
description: 'Paste clipboard content to one or more locations',
inputSchema: {
type: 'object',
properties: {
targets: {
type: 'array',
description: 'Array of paste targets',
items: {
type: 'object',
properties: {
file_path: {
type: 'string',
description: 'Target file path',
},
target_line: {
type: 'number',
description: 'Line number to paste at',
},
},
required: ['file_path', 'target_line'],
},
},
},
required: ['targets'],
},
},
{
name: 'show_clipboard',
description: 'Display current clipboard contents',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'undo_last_paste',
description: 'Undo the most recent paste operation',
inputSchema: {
type: 'object',
properties: {},
},
},
{
name: 'get_operation_history',
description: 'Retrieve operation history for debugging',
inputSchema: {
type: 'object',
properties: {
limit: {
type: 'number',
description: 'Max number of operations to return (default: 10)',
},
},
},
},
];