Skip to content

Commit b255215

Browse files
carlkiblerclaude
andcommitted
feat: expand MCP tool surface to 12 tools
Add tl_structure, tl_audit, tl_deps, tl_exports. tl_structure: project overview with token estimates; replaces ls -R patterns tl_audit: mid-session token waste analysis with savings breakdown tl_deps: file dependency tree without reading implementation tl_exports: public API surface of a module or directory Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 210a816 commit b255215

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

src/mcp-tools.mjs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,62 @@ export const TOOLS = [
183183
return dispatchTool('diff', args);
184184
},
185185
},
186+
{
187+
name: 'tl_structure',
188+
description: 'Project overview: directory tree with file counts and token estimates. Use this first when exploring an unfamiliar codebase instead of running ls -R or find.',
189+
schema: {
190+
path: z.string().optional().describe('Root path (default: cwd)'),
191+
depth: z.number().optional().describe('Max directory depth (default: 3)'),
192+
},
193+
handler: async ({ path, depth }) => {
194+
const args = [];
195+
if (path) args.push(path);
196+
if (depth) args.push('-d', String(depth));
197+
args.push('-j');
198+
return dispatchTool('structure', args);
199+
},
200+
},
201+
{
202+
name: 'tl_audit',
203+
description: 'Analyze token waste in this session or project. Shows what patterns are costing tokens and how many were already saved by tokenlean.',
204+
schema: {
205+
path: z.string().optional().describe('Project directory or session file to analyze (default: cwd)'),
206+
savings: z.boolean().optional().describe('Include tokens saved by tokenlean (default: false)'),
207+
all: z.boolean().optional().describe('Analyze all sessions, not just the most recent'),
208+
},
209+
handler: async ({ path, savings, all }) => {
210+
const args = [];
211+
if (path) args.push(path);
212+
if (savings) args.push('--savings');
213+
if (all) args.push('--all');
214+
args.push('-j');
215+
return dispatchTool('audit', args);
216+
},
217+
},
218+
{
219+
name: 'tl_deps',
220+
description: 'Show imports and dependency tree for a file. Reveals what a file depends on without reading it.',
221+
schema: {
222+
file: z.string().describe('File to show dependencies for'),
223+
depth: z.number().optional().describe('Dependency depth to traverse (default: 1)'),
224+
},
225+
handler: async ({ file, depth }) => {
226+
const args = [file];
227+
if (depth) args.push('-d', String(depth));
228+
args.push('-j');
229+
return dispatchTool('deps', args);
230+
},
231+
},
232+
{
233+
name: 'tl_exports',
234+
description: 'Show public API surface of a module or directory — what it exports without reading implementations.',
235+
schema: {
236+
path: z.string().describe('File or directory to analyze'),
237+
},
238+
handler: async ({ path }) => {
239+
return dispatchTool('exports', [path, '-j']);
240+
},
241+
},
186242
];
187243

188244
// ─────────────────────────────────────────────────────────────

0 commit comments

Comments
 (0)