Skip to main content
Glama

cursor_agent

Execute prompts with Cursor's AI agent to generate, review, or debug code; select model and mode, and get changed files plus model used.

Instructions

Execute a prompt using Cursor's AI agent with any model id the installed cursor-agent accepts (Composer, Claude, GPT, Gemini, Grok families on your plan; run cursor_models for ids). Modes: 'agent' (tools, terminal, search), 'plan' (design-focused), 'ask' (read-only). In headless mode cursor-agent only PROPOSES file changes unless the server operator set CURSOR_ALLOW_YOLO=true (then --force applies them; CURSOR_SANDBOX=enabled confines them). The result lists the files changed and the model used; a client that sends a progress token gets a progress notification per tool call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoAgent mode. 'agent' = full capabilities (file edit, terminal, search). 'plan' = design-focused, asks clarifying questions. 'ask' = read-only exploration. Default: agent.
modelNoAI model id as cursor-agent accepts it, passed through to --model (any id cursor_models lists; e.g. a Composer, Claude, GPT, Gemini or Grok id on your plan). Default: auto (Cursor picks the model). Was a closed list of old ids before 1.1.0.
promptYesThe prompt or task for the Cursor agent. Supports natural language instructions for code generation, review, debugging, and more.
workspaceNoWorking directory for the agent. Affects file search scope and project context. Default: server's current working directory.
timeout_secondsNoMaximum execution time in seconds (10-3600). Default: 600 (10 minutes).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesThe model cursor-agent reported at start (its display name), if it did
resultYesThe agent's final answer; without a result event, its last message, else empty (what stdout held is in noise_sample, never here)
statusYescursor-agent's result subtype: success, error, …; no-result-event when the run ended without one
stderrYes
is_errorYes
exit_codeYescursor-agent's exit code (null when it was killed)
request_idYes
session_idYesThe session to resume with cursor_reply
tool_callsYesCompleted tool calls the agent made
duration_msYes
noise_linesYesstdout lines that were not stream-json events (counted, never dropped)
noise_sampleYesThe first few of those lines, verbatim (500 characters each at most)
files_changedYesPaths of file-tool write/edit/delete calls that reported success, in order, each once. Shell commands are not inspected: a file written by a shell tool is not listed.
files_proposedYesPaths of file-tool write/edit/delete calls that did not report success (proposed without --force, refused, failed), each once

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses that in headless mode file changes are only PROPOSED unless CURSOR_ALLOW_YOLO=true, that --force then applies them, that CURSOR_SANDBOX=enabled confines them, and that the result lists changed files plus the model used. It even documents that progress tokens yield a notification per tool call, which is behavior an agent cannot infer from schema or annotations.

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?

Four information-dense sentences with no filler: capability and model scope first, then mode semantics, then the critical headless-safety caveat, then result/progress behavior. Every sentence carries load and the most consequential fact (propose-only vs --force) is placed where it will be read.

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 5-parameter, prompt-driven agent-execution tool with an output schema present, this is complete: execution modes, model sourcing, the propose-vs-apply safety model with its env-var controls, and progress-notification behavior are all covered, and return contents need not be detailed further given the output schema.

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

Parameters3/5

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

Schema description coverage is 100%, so mode, model, prompt, workspace, and timeout are all already documented in the schema, including the same mode definitions. The description's model-family enumeration and 'run cursor_models for ids' note restate schema content rather than adding syntax or constraints, so the baseline 3 applies.

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?

States a specific verb and resource ('Execute a prompt using Cursor's AI agent') and immediately scopes it by noting that any model id the installed cursor-agent accepts works, pointing to cursor_models for ids. An agent can distinguish this from cursor_reply, cursor_sessions, and cursor_health without opening any schema.

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?

The three modes are spelled out with their operational meaning ('agent' = tools/terminal/search, 'plan' = design-focused, 'ask' = read-only), which gives clear when-to-use guidance for mode selection, and cursor_models is named as the source of model ids. It stops short of explicit routing rules against sibling tools like cursor_reply or cursor_sessions, so it is clear context without exclusions.

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