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 rules/lazylagom/context-compose-mcp/debugging-troubleshootinggit clone --depth 1 https://github.com/lazylagom/context-compose-mcpWhat 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 | $0.00000 | $0.01008 |
| Opus 5 | $0.00000 | $0.00504 |
| Sonnet 5 | $0.00000 | $0.00202 |
| Haiku 4.5 | $0.00000 | $0.00101 |
Grade C, and why
debugging-troubleshooting scanned grade C with 1 finding 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 2d 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
rm -rf node_modules pnpm-lock.yaml How it starts
The opening of the file, as written. The whole thing — 192 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Debugging and Troubleshooting Guide
General Debugging Strategies
Logging and Console Output
- Development Mode: Output debugging information using
console.log - Structured Logging: Structured log messages in JSON format
- Error Stack Tracing: Include detailed error information and stack traces
TypeScript Type Errors
- Type Checking: Check entire project types with
npm run type-check - Gradual Type Application: Minimize
anytype usage and define specific types - Type Guards: Ensure type safety at runtime
MCP Server Debugging
MCP Server Inspection Tools
# Inspect MCP server under development
npm run inspect
# Inspect built MCP server
npm run inspect:built
Common MCP Issues
1. Tool Registration Failure
// Incorrect example
server.tool('invalid-tool', {
// Missing parameter schema
}, handler);
// Correct example
server.tool('valid-tool', {
description: 'Clear description',
parameters: z.object({
param: z.string().describe('Parameter description')
})
}, handler);
2. Type Mismatch Issues
- Zod Schema Validation: Type validation of input parameters
- TypeScript Type Definitions: Compile-time type safety
3. Asynchronous Processing Errors
// Properly handle Promise chains
server.tool('async-tool', schema, async (params) => {
try {
const result = await someAsyncOperation(params);
return { result };
} catch (error) {
throw new Error(`Operation failed: ${error.message}`);
}
});
CLI Debugging
CLI Command Testing
# Run CLI in local development mode
npm run context-compose -- --help
# Debug specific commands
npm run context-compose -- get-context default --verbose
Common CLI Issues
1. Command Parsing Errors
- Commander.js Configuration Check: Review command definitions in src/cli/index.ts
- Argument Validation: Distinguish between required and optional arguments
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.
- 2d ago First seen · 192 lines · 0 tokens per session scan C a38de5a86d50
debugging-troubleshooting is a cursor rule published in the GitHub repository lazylagom/context-compose-mcp (1 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,008 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
debug-commands
This tool performs debugging steps for applications.
tdd
Final Verification: Always use: go test -v ./backend/api/handler/... | grep FAIL.
api-testing
Cypress network interception and API testing patterns (cy.intercept, service mocking, request/response validation).
app-router-patterns
Next.js 14+ App Router patterns — Server Components, Client Components, Route Handlers, Server Actions, and metadata API.
general
You are running in Cursor IDE. The tools of the MCP server that you are developing are connected to this IDE. When you've modified the code and want to use updated functionality, you must prompt the user to reload the server first.
utilities
// ✅ DO: Create focused, reusable utilities /.