Skip to main content
Glama
habibafaisal

wherewent

analyze_job

Diagnose slow Python/SQLAlchemy jobs by running them and getting the exact call site, query count, and fix, with optional per-unit trend analysis.

Instructions

Run a Python/SQLAlchemy job under wherewent and return WHY it was slow.

    Use when a batch job is slow and you need the exact call site, query
    count, and fix — wherewent counts/groups/attributes deterministically in
    Python (zero token cost) and hands back machine fields to act on.

    Args:
        command: The job as an argv LIST, e.g. ["python", "job.py"] or
            ["python", "-m", "mypkg"]. TRUST BOUNDARY: this list is executed
            directly with NO shell (no shell=True) — no interpolation, no
            injection. The agent platform's sandbox is the outer boundary.
        unit_function: Optional SPEC (e.g. "myapp.jobs:process_receivable")
            to enable per-unit trend analysis (rising per-unit cost).
        timeout_s: Max seconds to let the job run (default 600). Real jobs can
            run for hours — on timeout the child is stopped and PARTIAL
            results are returned with timed_out=True. Partial data is a
            first-class use: read the per-unit growth trend.

    Returns an envelope: {"result": <enriched wherewent JSON or null>,
    "exit_code", "timed_out", "stderr_tail", "error"}. Each finding in
    result.findings carries fix/call_site/calls/evidence. Act on `fix`; cite
    `call_site` + `evidence`.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes
timeout_sNo
unit_functionNo
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden and does so excellently. It discloses the trust boundary (executed with NO shell), timeout behavior with partial results and timed_out=True, and return envelope fields. This goes well beyond a generic read/write hint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The text is longer than average, but every section earns its place: purpose, usage, Args, and Returns. Information is front-loaded and structured logically, making it easy to scan and apply.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with no annotations and no output schema, the description is remarkably complete. It covers purpose, usage, parameters, security, timeout behavior, return format, and even how to act on findings. This is more than sufficient for correct tool selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description compensates fully. It explains command as an argv list with security implications, unit_function as a spec for per-unit trend analysis, and timeout_s with default and partial-result behavior. Every parameter is given meaningful context beyond the raw schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it runs a Python/SQLAlchemy job under wherewent and returns why it was slow, with specifics like call site, query count, and fix. It is a specific verb+resource+outcome, but it does not explicitly compare itself with the sibling tool explain_run, even though the use case is implied.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"Use when a batch job is slow and you need the exact call site, query count, and fix" provides clear context for when to invoke. However, there are no explicit when-not-to-use conditions or named alternatives, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/habibafaisal/wherewent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server