Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/matt-dionis/claude-code-configs/add-toolgit clone --depth 1 https://github.com/Matt-Dionis/claude-code-configsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/matt-dionis/claude-code-configs/add-tool)<a href="https://agentmods.dev/commands/matt-dionis/claude-code-configs/add-tool"><img src="https://agentmods.dev/badge/commands/matt-dionis/claude-code-configs/add-tool.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01379 |
| Opus 5 | $0.00000 | $0.00690 |
| Sonnet 5 | $0.00000 | $0.00276 |
| Haiku 4.5 | $0.00000 | $0.00138 |
Grade A, and why
add-tool scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 207 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Add Tool to MCP Server
Adds a new tool to your MCP server with proper schema validation and error handling.
Usage
/add-tool <name> <description> [parameters]
Examples
/add-tool calculate "Performs mathematical calculations"
/add-tool search "Search for information" query:string limit:number?
/add-tool process_data "Process data with options" input:string format:enum[json,csv,xml]
Implementation
import { z } from 'zod';
import * as fs from 'fs/promises';
import * as path from 'path';
async function addTool(name: string, description: string, parameters?: string[]) {
// Parse parameters into schema
const schema = parseParameterSchema(parameters || []);
// Generate tool file
const toolContent = generateToolFile(name, description, schema);
// Write tool file
const toolPath = path.join('src/tools', `${name}.ts`);
await fs.writeFile(toolPath, toolContent);
// Update tool index
await updateToolIndex(name);
// Generate test file
const testContent = generateToolTest(name);
const testPath = path.join('tests/unit/tools', `${name}.test.ts`);
await fs.writeFile(testPath, testContent);
console.log(`✅ Tool "${name}" added successfully!`);
console.log(` - Implementation: ${toolPath}`);
console.log(` - Test file: ${testPath}`);
console.log(`\nNext steps:`);
console.log(` 1. Implement the tool logic in ${toolPath}`);
console.log(` 2. Run tests with "npm test"`);
console.log(` 3. Test with MCP Inspector`);
}
function parseParameterSchema(parameters: string[]): any {
const properties: Record<string, any> = {};
const required: string[] = [];
for (const param of parameters) {
const [nameType, ...rest] = param.split(':');
const isOptional = nameType.endsWith('?');
const name = isOptional ? nameType.slice(0, -1) : nameType;
const type = rest.join(':') || 'string';
if (!isOptional) {
required.push(name);
}
properties[name] = parseType(type);
}
return {
type: 'object',
properties,
required: required.length > 0 ? required : undefined,
};
}
function parseType(type: string): any {
if (type.startsWith('enum[')) {
const values = type.slice(5, -1).split(',');
return {
type: 'string',
enum: values,
};
}
switch (type) {
case 'number':
return { type: 'number' };
case 'boolean':
return { type: 'boolean' };
case 'array':
return { type: 'array', items: { type: 'string' } };
default:
return { type: 'string' };
}
}
function generateToolFile(name: string, description: string, schema: any): string {
return `
import { z } from 'zod';
import type { ToolHandler } from '../types/tools.js';
// Define Zod schema for validation
const ${capitalize(name)}Schema = z.object({
${generateZodSchema(schema.properties, ' ')}
});
export type ${capitalize(name)}Args = z.infer<typeof ${capitalize(name)}Schema>;
export const ${name}Tool = {
name: '${name}',
description: '${description}',
inputSchema: ${JSON.stringify(schema, null, 2)},
handler: async (args: unknown): Promise<ToolHandler> => {
// Validate input
const validated = ${capitalize(name)}Schema.parse(args);
// TODO: Implement your tool logic here
const result = await process${capitalize(name)}(validated);
return {
content: [
{
type: 'text',
text: JSON.stringify(result),
},
],
};
},
};
async function process${capitalize(name)}(args: ${capitalize(name)}Args) {
// TODO: Implement the actual processing logic
return {
success: true,
message: 'Tool executed successfully',
input: args,
};
}
`;
}
function generateZodSchema(properties: Record<string, any>, indent: string): string {
const lines: string[] = [];
for (const [key, value] of Object.entries(properties)) {
let zodType = 'z.string()';
if (value.type === 'number') {
zodType = 'z.number()';
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 207 lines · 0 tokens per session scan A 6473a9fba57b
add-tool is a command published in the GitHub repository Matt-Dionis/claude-code-configs (625 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,379 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.