Skip to main content
Glama
syrian963

django-chainsaw-mcp

by syrian963

celery_arguments

Read-onlyIdempotent

Validate Celery task argument usage by scanning code for mismatched signatures and serialization risks, preventing runtime errors.

Instructions

Model instances handed to Celery tasks, and calls whose arity is wrong.

    order = Order.objects.get(pk=pk)
    send_confirmation.delay(order)

The worker does not get that order. It gets whatever the serialiser made
of it, rehydrated later on another machine: the row may have changed in
between, the whole object crosses the broker, and under the JSON
serialiser - the default since Celery 4 - it may not encode at all. Pass
the primary key and let the task load it.

Also reports a dispatch whose argument count cannot match the task.
Celery's strict_typing catches that at call time, which for a nightly job
or an error branch means in production, months later.

flake8-pie has Celery lints for names, crontab arguments and expirations.
None of them look at what is passed.

A dispatch is only checked when the name resolves to a task this project
defines, through the file's own imports - matching on the bare name
reported unrelated objects of the same name against the task's signature.

Args:
    search_path: directory to scan. Defaults to the configured project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
search_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A3.7/5.0
Behavior4/5

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

Beyond the readOnly/idempotent annotations, the description explains that the tool reports two distinct issue types and discloses an important limitation: matching on the bare name may report 'unrelated objects of the same name against the task's signature.' It also clarifies that checks depend on import resolution, giving the agent a realistic sense of the tool's coverage and potential false positives.

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

Conciseness3/5

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

The description is front-loaded with the core purpose and includes an Args section, but the middle paragraphs contain a lengthy narrative example and Celery background that could be shortened. The flake8-pie comparison is useful context, but the overall length is higher than necessary for an agent selecting and invoking the tool.

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

Completeness4/5

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

Given the tool's complexity and that an output schema exists (so return values are presumably defined), the description covers the main behavior, the search_path parameter's meaning and default, and a notable limitation. An agent has enough information to invoke it correctly and interpret its scope, though it could state the output format or expected result types explicitly if the output schema were not present.

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

Parameters4/5

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

The schema provides only the name, type, and default for search_path; the description compensates by stating it is 'a directory to scan' and defaults to the configured project. This is brief but sufficient for an optional single parameter, even though schema coverage is 0%.

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 opening sentence, 'Model instances handed to Celery tasks, and calls whose arity is wrong,' clearly identifies the two problem categories the tool detects. The title and the rest of the description confirm it is a static analysis tool, though it lacks an explicit verb like 'reports' or 'scans.'

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

Usage Guidelines3/5

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

The description indirectly signals when to use this tool by contrasting with flake8-pie: 'None of them look at what is passed.' It also describes a search_path default and the condition that a dispatch is 'only checked when the name resolves to a task this project defines,' which gives context for effective use. However, it never explicitly states when to prefer this tool over sibling tools or provides exclusion criteria.

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