pandas-doctor
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
pandas-doctor finds slow pandas patterns and proves rewrites. Before telling a user that a pandas rewrite is equivalent or faster, call verify_rewrite with the original code, the rewrite, and setup code that builds representative inputs. Report its verdict and timings as returned; they hold for the given inputs only.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| check_codeA | Scan Python source for slow pandas patterns (iterrows loops, row-wise apply, concat in a loop, cell-by-cell writes, groupby-apply aggregates) without running it. Use this first, to find what is worth rewriting. Each finding has a rule code (see list_rules), a line, a severity, a message and often a suggested rewrite. Suggestions are not verified: before telling the user a rewrite is equivalent or faster, call verify_rewrite on representative inputs. Read-only: the code is parsed, never executed. |
| verify_rewriteA | Check that a pandas rewrite gives the same result as the original, and measure whether it is faster. Use this before telling the user a rewrite is equivalent or faster; use check_code to find candidates. Runs setup once, then original and candidate on separate copies of its variables, compares each output strictly (type, dtype, index, names, NaN positions, exact values) and times both (median of repeated runs, about 2 s budget). Side effects: executes the given code locally. original and candidate must be pure
computation (no file, network, subprocess or global-state calls, no unseeded randomness);
otherwise nothing runs and
|
| list_rulesA | List the slow pandas patterns pandas-doctor knows, with their rule codes. Use this to look up a code from a check_code finding (PDD001 ...) or to see which patterns
are covered. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 3 tools
Each tool maps to a distinct phase of one workflow: check_code finds candidates, list_rules explains rule codes, verify_rewrite validates a proposed rewrite. The descriptions explicitly cross-reference each other, making selection unambiguous even though check_code and verify_rewrite both touch rewrites.
All three names use a strict verb_noun snake_case pattern (check_code, list_rules, verify_rewrite) with the verb accurately reflecting the action.
Three tools is at the lean end, but each covers a necessary step (detect, reference, verify) with no redundancy. It borders on thin for a linter/verifier surface but nothing is padded.
The scan → look-up → verify loop is closed, but there is no way to apply or emit a rewritten file, filter by severity/rule, or scan a directory, and the descriptions reference a `pandas-doctor run` runtime mode that is not exposed as a tool. Fix-application and runtime checking are notable gaps agents would hit after verification.