Sponsor Suno AI Music arrow_forward
Slash Command

Debug Api

Debug API failures using OpenAPI specs and HTTP logs

Type
Slash Command
GitHub stars
2.8k
License
MIT
Repo last updated
Sep 27, 2026

What Debug Api is

Debug Api is a slash command published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”

A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.

Debug Api gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.

How to install Debug Api

Claude Code

  1. Download debug-api.md from the repository.
  2. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
  3. Run it by typing / followed by its name.

Claude Cowork

  1. Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
  2. In Customize → Skills, click +, then upload the ZIP.
  3. Run it from any task with / and the skill name.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from plugins/mcp/conversational-api-debugger/commands/debug-api.md, shared under the repository's MIT license. Read the full file on GitHub.

Systematically debug REST API failures by analyzing OpenAPI specifications and HTTP request/response logs.

Workflow

When the user requests API debugging, follow this comprehensive approach:

Step 1: Load API Documentation

Use load_openapi to parse the OpenAPI spec:
- Accepts JSON or YAML format
- Extracts all endpoints, parameters, and expected responses
- Identifies authentication requirements
- Captures base URLs and server information

Example:
load_openapi({
  filePath: "/path/to/openapi.yaml",
  name: "my-api"
})

Step 2: Ingest HTTP Logs

Use ingest_logs to import request/response data:
- Supports HAR (HTTP Archive) format from browser DevTools
- Accepts direct log arrays
- Automatically categorizes successful vs failed requests
- Calculates status code and method distributions

Example (HAR file):
ingest_logs({
  filePath: "/path/to/requests.har",
  format: "har"
})

Example (direct logs):
ingest_logs({
  logs: [
    {
      timestamp: "2025-10-10T12:00:00Z",
      method: "POST",
…

Step 3: Analyze Failures

Use explain_failure to understand why requests failed:
- Identifies root causes based on HTTP status codes
- Compares actual behavior with OpenAPI spec expectations
- Suggests specific fixes
- Assesses severity (critical, high, medium, low)

Example:
explain_failure({
  logIndex: 0,  // Index from ingest_logs
  specName: "my-api"  // Compare against loaded spec
})

Step 4: Generate Reproducible Tests

Use make_repro to create cURL commands:
- Generates executable cURL command
- Includes alternative formats (HTTPie, JavaScript fetch)
- Useful for documentation, bug reports, and testing

Example:
make_repro({
  logIndex: 0,
  includeHeaders: true,
  pretty: true  // Format for readability
})

Common Debugging Scenarios

Scenario 1: 400 Bad Request

  1. Load spec to see expected request format
  2. Ingest logs containing the failure
  3. Explain failure to identify validation errors
  4. Make repro to generate test command
  5. Fix request based on schema requirements
  6. Test using generated cURL command

Scenario 2: 401 Unauthorized

  1. Load spec to check authentication requirements
  2. Explain failure on 401 response
  3. Verify authentication headers in request
  4. Check token expiration or permissions
  5. Make repro with corrected auth headers

Scenario 3: 500 Internal Server Error

  1. Ingest logs to find pattern of 500 errors
  2. Explain failure to assess criticality
  3. Make repro for server team to reproduce
  4. Check request payload for edge cases
  5. Monitor server logs (not in scope of this tool)

Scenario 4: Performance Issues

  1. Ingest logs with duration data
  2. Analyze distribution of response times
  3. Identify slow endpoints
  4. Make repro for performance testing

Analysis Output

The debugging workflow produces:

From explain_failure:

  • Severity: critical | high | medium | low
  • Possible Causes: List of likely root causes
  • Suggested Fixes: Actionable remediation steps
  • Matching Endpoint: Comparison with OpenAPI spec
  • Details: Request/response bodies for inspection

From make_repro:

  • cURL Command: Copy-paste ready command
  • HTTPie Alternative: Shorter syntax for quick tests
  • JavaScript fetch: For integration into automated tests
  • Metadata: Method, URL, headers, body presence

Best Practices

  1. Always load the OpenAPI spec first - Provides context for failure analysis
  2. Use HAR files when possible - Most complete log format
  3. Include request/response bodies - Critical for validation errors
  4. Compare with spec - Catches mismatches between docs and implementation
  5. Generate repro commands - Makes bug reports actionable
  6. Test fixes immediately - Use generated cURL to verify

Tips

  • Export HAR from browser DevTools (Network tab → Right-click → Save as HAR)
  • Use pretty: true for readable cURL commands (good for docs)
  • Use pretty: false for one-liner cURL (good for scripts)

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Debug Api?

Debug Api is a slash command for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Debug API failures using OpenAPI specs and HTTP logs

How do I install Debug Api in Claude Code?

Download debug-api.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.

Can I use Debug Api in Claude Cowork?

Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.

Is Debug Api safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.