Borrowing it
Nothing to install: this file belongs to rshade/mcp-devtools-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/rshade/mcp-devtools-server/main/.claude/commands/implement-python-tool.mdgit clone --depth 1 https://github.com/rshade/mcp-devtools-serverWrote 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/rshade/mcp-devtools-server/implement-python-tool)<a href="https://agentmods.dev/commands/rshade/mcp-devtools-server/implement-python-tool"><img src="https://agentmods.dev/badge/commands/rshade/mcp-devtools-server/implement-python-tool/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/rshade/mcp-devtools-server/implement-python-tool"><img src="https://agentmods.dev/badge/commands/rshade/mcp-devtools-server/implement-python-tool.svg" alt="Reviewed on agentmods" width="80" 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.01313 |
| Opus 5.5 | $0.00000 | $0.00525 |
| Sonnet 5.5 | $0.00000 | $0.00263 |
| Haiku 4.5 | $0.00000 | $0.00131 |
Grade A, and why
implement-python-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 1mo 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 — 187 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Implement a Python tool using a specialized Haiku-powered agent.
Usage: /implement-python-tool [issue-number]
This command launches a cost-efficient Haiku agent that implements a single Python tool from the Epic #131 following established patterns with cache optimization.
Example:
/implement-python-tool 132
Implements python_project_info from issue #132.
Launch the Python implementation agent with Haiku model for issue #{{ISSUE_NUMBER}}.
Use the Task tool with:
- subagent_type: general-purpose
- model: haiku
- prompt: Detailed implementation instructions below
Task for Agent:
You are implementing Python tool support for MCP DevTools Server. Your mission: Implement the tool specified in GitHub issue #{{ISSUE_NUMBER}} following the exact Go tools pattern with cache optimization built in.
Phase 1: Research (Read these files)
- Read issue:
gh issue view {{ISSUE_NUMBER}} --repo rshade/mcp-devtools-server - Read Go tools reference:
src/tools/go-tools.ts(focus on structure) - Read cache patterns:
src/utils/cache-manager.tsandCACHING.md - Read test patterns:
src/__tests__/tools/go-tools.test.ts
Phase 2: Implementation
Create src/tools/python-tools.ts (or add to existing) following this structure:
import { z } from 'zod';
import { ShellExecutor } from '../utils/shell-executor.js';
import { CacheManager } from '../utils/cache-manager.js';
import * as crypto from 'crypto';
// 1. Define Zod schema from issue
const PythonXxxSchema = z.object({
directory: z.string().optional(),
// ... parameters from issue
});
type PythonXxxArgs = z.infer<typeof PythonXxxSchema>;
interface PythonToolResult {
success: boolean;
data?: any;
error?: string;
}
export class PythonTools {
constructor(private shellExecutor: ShellExecutor) {}
// 2. Main tool method WITH CACHING
async pythonXxx(args: PythonXxxArgs): Promise<PythonToolResult> {
const validated = PythonXxxSchema.parse(args);
const directory = validated.directory || process.cwd();
// CACHE CHECK (required, not optional!)
const cacheKey = this.generateXxxCacheKey(directory, validated);
const cached = await CacheManager.getInstance().get('python_tools', cacheKey);
if (cached) return cached as PythonToolResult;
// Build command incrementally
const cmd = ['tool-name'];
// ... add args
// Execute
const result = await this.shellExecutor.executeCommand(
cmd.join(' '),
directory,
{ timeout: 60000 }
);
// Parse
const parsed = this.parseXxxOutput(result);
// CACHE RESULT (use TTL from issue)
if (parsed.success) {
await CacheManager.getInstance().set('python_tools', cacheKey, parsed, TTL);
}
return parsed;
}
// 3. Cache key generator
private generateXxxCacheKey(dir: string, args: PythonXxxArgs): string {
const params = { /* all parameters */ };
const hash = crypto.createHash('sha256')
.update(JSON.stringify(params))
.digest('hex')
.substring(0, 16);
return `python:xxx:${dir}:${hash}`;
}
// 4. Output parser
private parseXxxOutput(result: any): PythonToolResult {
// Parse stdout/stderr from issue examples
return { success: result.exitCode === 0, data: {} };
}
// 5. Static validator
static validatePythonXxx(args: unknown) {
return PythonXxxSchema.safeParse(args);
}
}
Phase 3: Testing
Create src/__tests__/tools/python-tools.test.ts:
import { describe, it, expect, beforeEach } from '@jest/globals';
import { PythonTools } from '../../tools/python-tools.js';
import { CacheManager } from '../../utils/cache-manager.js';
describe('PythonTools - pythonXxx', () => {
let pythonTools: PythonTools;
let mockShellExecutor: any;
beforeEach(() => {
CacheManager.resetInstance(); // CRITICAL!
mockShellExecutor = createMockShellExecutor();
pythonTools = new PythonTools(mockShellExecutor);
});
// Test all requirements from issue
it('executes successfully', async () => { /* ... */ });
it('caches results', async () => { /* verify callCount === 1 */ });
it('handles errors', async () => { /* ... */ });
// ... more tests from issue
});
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.
- 1mo ago First seen · 187 lines · 0 tokens per session scan A 3bf6a52cc08f
implement-python-tool is a command published in the GitHub repository rshade/mcp-devtools-server (5 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,313 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-31.
Other commands, from other repositories
sugar-analyze
Analyze codebase for potential work and automatically create tasks.
sugar-review
Review and manage pending Sugar tasks interactively.
sugar-run
Start Sugar's autonomous execution mode.
sugar-status
View Sugar system status, task queue, and execution metrics.
sugar-task
Create a comprehensive Sugar task with rich context and metadata.
sugar-thinking
View Claude's thinking logs for task execution.