Cursor: run agent
cursor_run_agentExecute a coding agent in a working directory to read, edit, write files and run shell commands, returning an agent ID for follow-up conversations.
Instructions
Run a Cursor Agent (local runtime) against a working directory and return the final result. The agent can read, edit, and write files and run shell commands in cwd. Returns an agentId you can pass to cursor_follow_up to continue the same conversation.
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": {
"prompt": "<prompt>",
"cwd": "<cwd>"
},
"name": "cursor_run_agent"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Instruction for the Cursor Agent. | |
| cwd | Yes | Absolute path to the working directory the agent operates in. | |
| model | No | Model id (e.g. "composer-2.5"). Defaults to the server default ("auto"). | |
| mode | No | "agent" implements changes directly; "plan" explores and plans first. |