-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathindex.ts
More file actions
52 lines (47 loc) · 1.85 KB
/
index.ts
File metadata and controls
52 lines (47 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
export type { ToolContext, ToolResponse, ToolPaths } from './types.js';
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
import { definition as d1, handle as h1 } from './search-codebase.js';
import { definition as d2, handle as h2 } from './get-codebase-metadata.js';
import { definition as d3, handle as h3 } from './get-indexing-status.js';
import { definition as d4, handle as h4 } from './refresh-index.js';
import { definition as d5, handle as h5 } from './get-style-guide.js';
import { definition as d6, handle as h6 } from './get-team-patterns.js';
import { definition as d7, handle as h7 } from './get-symbol-references.js';
import { definition as d8, handle as h8 } from './detect-circular-dependencies.js';
import { definition as d9, handle as h9 } from './remember.js';
import { definition as d10, handle as h10 } from './get-memory.js';
import type { ToolContext, ToolResponse } from './types.js';
export const TOOLS: Tool[] = [d1, d2, d3, d4, d5, d6, d7, d8, d9, d10];
export async function dispatchTool(
name: string,
args: Record<string, unknown>,
ctx: ToolContext
): Promise<ToolResponse> {
switch (name) {
case 'search_codebase':
return h1(args, ctx);
case 'get_codebase_metadata':
return h2(args, ctx);
case 'get_indexing_status':
return h3(args, ctx);
case 'refresh_index':
return h4(args, ctx);
case 'get_style_guide':
return h5(args, ctx);
case 'get_team_patterns':
return h6(args, ctx);
case 'get_symbol_references':
return h7(args, ctx);
case 'detect_circular_dependencies':
return h8(args, ctx);
case 'remember':
return h9(args, ctx);
case 'get_memory':
return h10(args, ctx);
default:
return {
content: [{ type: 'text', text: JSON.stringify({ error: `Unknown tool: ${name}` }) }],
isError: true
};
}
}