Skip to main content
Glama

Offload a heavy read-only task

offload_submit_task

Submits a heavy read-only scanning or analysis task to a background worker and returns a job ID immediately, so you can avoid reading large files yourself.

Instructions

Hand a heavy READ-ONLY task to a background worker agent (default: agy) and get a job_id back immediately.

Use it when the work means reading a lot but the answer is small: scanning many files, filtering large logs, analyzing a big bundle or resource file, inventorying APIs/strings/config across a tree. The worker replies with a short Summary plus Findings with path:line evidence, so you read a few hundred words instead of the files.

Do NOT use it for edits, for small lookups you can do in one or two reads, or for anything security-sensitive you must verify line by line yourself. The worker is another model: treat its findings as leads and spot-check the ones you act on.

Write a complete BRIEF. The worker executes it literally and does nothing else, so anything you leave vague it will skip or guess:

  • task: the goal as one concrete question.

  • steps: ordered, concrete actions; each names what to open or search and what to record.

  • output_hint: the exact shape of the Findings (columns, grouping, sort order, what goes in each column).

  • done_when: the stop condition, so the worker neither stops early nor wanders.

  • context (optional): what you already know (conventions, file roles), so the worker does not rediscover it.

  • exclude (optional): files, folders or kinds of results to leave out. The worker returns a Step log; the status tells you which steps it did not finish and which in-scope files it never opened.

Each job costs the worker a fixed preamble (about 20k tokens for agy) before it reads anything, so do small lookups yourself. A brief identical to a finished job, over unchanged files, returns that job instead of running again (reuse=false to force a new run).

Next: call offload_get_status with the job_id and wait_sec=50 until it finishes. To ask the worker more about its report, use offload_followup: it keeps what the worker already read.

Example: task="Which HTTP endpoints does api/v1 register, and what auth does each require?" steps=["List every .php file under api/v1 from FILES IN SCOPE.", "In each file, find each route: URL path and the HTTP methods it accepts.", "For each route, record the auth check it calls (function name), or 'none'."] output_hint="table: url | methods | auth check | handler path:line, sorted by url" done_when="Every file under api/v1 has been read and every route is in the table." exclude=["api/v1/tests/"]

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "task": "<task>",
      "steps": "<steps>",
      "output_hint": "<output_hint>",
      "done_when": "<done_when>"
    },
    "name": "offload_submit_task"
  }
}

Input Schema

NameRequiredDescriptionDefault
taskYesThe goal: one concrete question the report must answer, e.g. "Which endpoints in api/v1 skip the CSRF check?"
tierNoWorker model tier, when the backend defines tiers: low for mechanical inventories, medium by default, high for hard reading or a retry after a weak result.
modelNoExact worker model id; overrides tier.
pathsNoFiles or folders to focus on, relative to the workspace, e.g. ["api/core", "dist/app.js"]. Empty = whole workspace.
reuseNoReturn a finished job with the same brief over unchanged files instead of running again.
stepsYesOrdered actions for the worker, each concrete: what to open or search, what to record. The worker performs exactly these, in order, and logs each as done/partial/not done.
backendNoBackend name from the config. Available: agy.
contextNoFacts you already know that save the worker time: conventions, which file does what, names to look for.
excludeNoWhat to leave out: files, folders, or kinds of results, e.g. ["tests/", "commented-out code"].
done_whenYesStop condition, e.g. "every file under api/v1 is read and every route is listed".
workspaceNoAbsolute workspace path. Defaults to the current project; other paths must be listed in allowedRoots.
output_hintYesExact shape of the Findings, e.g. "table: name | path:line | purpose, sorted by path".
timeout_secNoKill the worker after this many seconds. Defaults to the backend's timeoutSec.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.2

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the annotations: discloses the ~20k-token fixed preamble cost, the run-deduplication/`reuse=false` behavior, that the worker is another model whose findings should be spot-checked, and that a Step log reveals unfinished steps and unopened files. The 'READ-ONLY' framing refers to the delegated task's nature, not the tool's state effects, so it does not contradict `readOnlyHint: false` (the tool does create a job) — but it sits close enough to the line that a clarifying clause would help.

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

Conciseness4/5

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

Front-loaded with purpose and the primary when/when-not split, then a clean bulleted brief spec, then workflow chaining. It runs long, and the 'do small lookups yourself' advice appears twice (once as an exclusion, once as the preamble-cost rationale), but that repetition carries new justification each time rather than padding.

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 13-parameter tool with no output schema, the description covers the return shape (Summary plus Findings with path:line evidence, Step log, status), the cost model, failure/partial-completion signals, and the next-step call with a concrete parameter value. An agent could invoke this correctly and interpret the result without opening any sibling documentation.

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?

Schema coverage is 100%, so baseline is 3, but the description adds real semantic value for the four required parameters by explaining *why* each matters ('the worker executes it literally and does nothing else, so anything you leave vague it will skip or guess') and by giving a worked example brief. Optional params like tier, paths, timeout_sec, and workspace are left entirely to the schema, which is acceptable given full coverage.

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

Purpose5/5

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

Names a specific verb and resource ('hand a heavy READ-ONLY task to a background worker agent') and states the immediate result ('get a job_id back immediately'). It also draws the boundary against sibling offload_followup and offload_get_status by describing the follow-on workflow rather than leaving the agent to guess.

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

Usage Guidelines5/5

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

Gives explicit when-to-use criteria ('reading a lot but the answer is small', with concrete examples like scanning many files and filtering large logs) and explicit when-not-to ('edits', 'small lookups you can do in one or two reads', 'security-sensitive' work). It also routes to the alternatives: do small lookups yourself, call offload_get_status for polling, use offload_followup for extraction.

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