# api detective

> Deterministic API debugging and repair toolkit for diagnosing connectivity, auth, and schema contract failures.

api detective is a free AI agent skill on Agensi by Mohammad Tahmid Zoayed, in APIs & Backend. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Mohammad Tahmid Zoayed](https://www.agensi.io/creators/mohammad-tahmid-zoayed)
- Category: [APIs & Backend](https://www.agensi.io/skills/apis-backend)
- Version: 1.0
- Last updated: 2026-11-23
- Security: scan passed (2026-11-23); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/api-detective
- Tags: api, testing, python, openapi, security

## About this skill

API integration failures often result in hours of manual log digging, header inspection, and trial-and-error debugging. API Detective replaces guesswork with a deterministic diagnostic engine that identifies root causes across connectivity, authentication, and schema contracts.

### What it does
- **Automated Diagnostics** runs a 43-check engine to identify failures in connectivity, auth, and request construction.
- **Contract Validation** matches request and response payloads against OpenAPI 3.0/3.1 or JSON Schema specifications.
- **Security Auditing** scans local repositories for integration bugs and insecure patterns like disabled TLS verification.
- **Secret Redaction** automatically filters API keys, Bearer tokens, and JWTs from all logs and reports.
- **Unified Diff Generation** proposes precise code fixes with risk assessments for developer approval.
- **Multi-format Reporting** compiles findings into developer-ready Markdown, JSON, or dark-mode HTML reports.

### How it works
1. **Collect Artifacts** by pointing the tool at an endpoint URL, local repository path, or OpenAPI specification file.
2. **Run Investigation** using `scripts/diagnose.py` to execute the agentic orchestrator against the target.
3. **Analyze Hypotheses** to view ranked root causes categorized by confidence scores and verifiable evidence.
4. **Apply and Verify** by generating a unified diff for the fix and re-running the diagnostic suite to confirm resolution.

### Frameworks & tools
Built for Python 3.12+ environments. Compatible with OpenAPI 3.0/3.1, Swagger 2.0, and JSON Schema. Supports auditing Python (requests, httpx) and JavaScript/TypeScript (axios, fetch) integrations.

### Why this beats prompting it yourself
Generic prompts often hallucinate API field names or suggest insecure fixes like disabling SSL. This skill uses a deterministic engine with local scripts to provide verifiable diagnostic IDs and SSRF-safe execution without requiring external LLM API keys.

### Use cases
- Debugging 401/403 errors by inspecting JWT claims and OAuth 2.0 headers.
- Validating production payloads against evolving OpenAPI contracts to catch breaking changes.
- Auditing local source code for hardcoded secrets or incorrect library implementations.
- Troubleshooting SSRF-protected connectivity issues between microservices.

### Known limitations
Requires Python 3.12 or higher. Deterministic checks are limited to the 43 predefined diagnostic codes. Fixes are proposed as diffs and require manual approval before file modification.

## Requires

- Python

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the api detective skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does API Detective differ from simply asking an AI to debug my code?

API Detective identifies the root cause of integration failures by running a 43-check diagnostic engine across connectivity, authentication, and schema contracts, then generates precise code fixes to resolve the issue.

### Which programming languages and libraries are supported for code auditing?

The toolkit is designed for Python 3.12+ environments and supports auditing integrations written in Python (requests, httpx) as well as JavaScript/TypeScript (axios, fetch).

### Can I use this skill with my existing OpenAPI or Swagger specifications?

It is compatible with OpenAPI 3.0/3.1, Swagger 2.0, and JSON Schema, allowing you to validate live request/response payloads against your existing documentation.

### Does the tool handle sensitive information like API keys securely?

Yes, it includes a dedicated secret redaction layer that automatically filters API keys, Bearer tokens, and JWTs from all diagnostic logs and reports before they are generated.

### What exactly is included in the purchase of this skill?

You receive the full diagnostic engine, the agentic orchestrator (scripts/diagnose.py), local auditing scripts, and a suite of reporting templates for Markdown, JSON, and HTML outputs.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
