Add tool documentation MCP tools for queryable TOOLS.md replacement
- Created tool_docs table with pgvector support (migration 015) - Added 5 MCP tools: tool_doc_add, tool_doc_search, tool_doc_get, tool_doc_list, tool_doc_export - Imported 268 tools from TOOLS.md to database - Enables semantic search for tool documentation (when embeddings available) - Reduces context pollution (TOOLS.md is 11,769 lines, now queryable) Task: CF-249 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
39
src/index.ts
39
src/index.ts
@@ -38,6 +38,7 @@ import {
|
||||
componentGraph,
|
||||
} from './tools/impact.js';
|
||||
import { memoryAdd, memorySearch, memoryList, memoryContext } from './tools/memories.js';
|
||||
import { toolDocAdd, toolDocSearch, toolDocGet, toolDocList, toolDocExport } from './tools/tool-docs.js';
|
||||
import {
|
||||
sessionStart,
|
||||
sessionUpdate,
|
||||
@@ -374,6 +375,44 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
result = await memoryContext(a.project, a.task_description);
|
||||
break;
|
||||
|
||||
// Tool Documentation
|
||||
case 'tool_doc_add':
|
||||
result = await toolDocAdd({
|
||||
tool_name: a.tool_name,
|
||||
category: a.category,
|
||||
title: a.title,
|
||||
description: a.description,
|
||||
usage_example: a.usage_example,
|
||||
parameters: a.parameters,
|
||||
notes: a.notes,
|
||||
tags: a.tags,
|
||||
source_file: a.source_file,
|
||||
});
|
||||
break;
|
||||
case 'tool_doc_search':
|
||||
result = await toolDocSearch({
|
||||
query: a.query,
|
||||
category: a.category,
|
||||
tags: a.tags,
|
||||
limit: a.limit,
|
||||
});
|
||||
break;
|
||||
case 'tool_doc_get':
|
||||
result = await toolDocGet({
|
||||
tool_name: a.tool_name,
|
||||
});
|
||||
break;
|
||||
case 'tool_doc_list':
|
||||
result = await toolDocList({
|
||||
category: a.category,
|
||||
tag: a.tag,
|
||||
limit: a.limit,
|
||||
});
|
||||
break;
|
||||
case 'tool_doc_export':
|
||||
result = await toolDocExport();
|
||||
break;
|
||||
|
||||
// Sessions
|
||||
case 'session_start':
|
||||
result = await sessionStart({
|
||||
|
||||
Reference in New Issue
Block a user