/** * GraphTools - MCP tool handlers for knowledge graph operations * * Tools: * - graph_upsert_entity * - graph_add_observation * - graph_link_entities (also handles unlink via action parameter) * - graph_search * - graph_open_nodes * - graph_delete_entity (also handles observation deletion via observationId) * - graph_maintain (rebuild, compact, verify operations) */ import { MemoryBankManager } from '../../core/MemoryBankManager.js'; /** * Graph tool definitions for MCP registration */ export declare const graphTools: ({ name: string; description: string; inputSchema: { type: string; properties: { name: { type: string; description: string; }; entityType: { type: string; description: string; }; attrs: { type: string; description: string; additionalProperties: boolean; }; storeId: { type: string; description: string; }; }; required: string[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { entity: { type: string; description: string; }; text: { type: string; description: string; }; source: { type: string; description: string; }; timestamp: { type: string; description: string; }; storeId: { type: string; description: string; }; }; required: string[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { action: { type: string; enum: string[]; description: string; }; from: { type: string; description: string; }; relationType: { type: string; description: string; }; to: { type: string; description: string; }; storeId: { type: string; description: string; }; }; required: string[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { query: { type: string; description: string; }; limit: { type: string; description: string; }; includeNeighborhood: { type: string; description: string; }; neighborhoodDepth: { type: string; description: string; enum: number[]; }; storeId: { type: string; description: string; }; }; required: string[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { nodes: { type: string; items: { type: string; }; description: string; }; depth: { type: string; description: string; enum: number[]; }; storeId: { type: string; description: string; }; }; required: string[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { entity: { type: string; description: string; }; observationId: { type: string; description: string; }; storeId: { type: string; description: string; }; }; required: string[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { operation: { type: string; enum: string[]; description: string; }; storeId: { type: string; description: string; }; }; required: string[]; }; })[]; /** * Handler for graph_upsert_entity */ export declare function handleGraphUpsertEntity(memoryBankManager: MemoryBankManager, name: string, entityType: string, attrs?: Record, storeId?: string): Promise<{ content: { type: string; text: string; }[]; isError: boolean; } | { content: { type: string; text: string; }[]; isError?: undefined; }>; /** * Handler for graph_add_observation */ export declare function handleGraphAddObservation(memoryBankManager: MemoryBankManager, entity: string, text: string, source?: string, timestamp?: string, storeId?: string): Promise<{ content: { type: string; text: string; }[]; isError: boolean; } | { content: { type: string; text: string; }[]; isError?: undefined; }>; /** * Handler for graph_link_entities (also handles unlink via action parameter) */ export declare function handleGraphLinkEntities(memoryBankManager: MemoryBankManager, from: string, relationType: string, to: string, storeId?: string, action?: 'link' | 'unlink'): Promise<{ content: { type: string; text: string; }[]; isError: boolean; } | { content: { type: string; text: string; }[]; isError?: undefined; }>; /** * Handler for graph_search */ export declare function handleGraphSearch(memoryBankManager: MemoryBankManager, query: string, limit?: number, includeNeighborhood?: boolean, neighborhoodDepth?: 1 | 2, storeId?: string): Promise<{ content: { type: string; text: string; }[]; isError: boolean; } | { content: { type: string; text: string; }[]; isError?: undefined; }>; /** * Handler for graph_open_nodes */ export declare function handleGraphOpenNodes(memoryBankManager: MemoryBankManager, nodes: string[], depth?: 1 | 2, storeId?: string): Promise<{ content: { type: string; text: string; }[]; isError: boolean; } | { content: { type: string; text: string; }[]; isError?: undefined; }>; /** * Handler for graph_delete_entity * Can also delete observations when observationId is provided */ export declare function handleGraphDeleteEntity(memoryBankManager: MemoryBankManager, entity?: string, observationId?: string, storeId?: string): Promise<{ content: { type: string; text: string; }[]; isError: boolean; } | { content: { type: string; text: string; }[]; isError?: undefined; }>; /** * Handler for graph_maintain - consolidated maintenance operations */ export declare function handleGraphMaintain(memoryBankManager: MemoryBankManager, operation: 'rebuild' | 'compact' | 'stats', storeId?: string): Promise<{ content: { type: string; text: string; }[]; isError: boolean; } | { content: { type: string; text: string; }[]; isError?: undefined; }>; //# sourceMappingURL=GraphTools.d.ts.map