---
title: "MCP Tool Reference"
description: "Every tool the TestOrchestrator MCP server exposes — discovery, projects, test cases, folders, comments, runs, cycles, attachments, and traceability — with its arguments."
source: "https://testorchestrator.com/docs/mcp/tools"
---

# MCP Tool Reference

The TestOrchestrator MCP server exposes **40 tools**. This page documents 37 of them, grouped by area — discovery, projects, test cases, folders, comments, test runs, cycles, attachments, and traceability. The other three work with automated results: `get_automated_results` lists the automated results uploads wrote in a project, `get_case_by_automation_key` finds the case that holds an automation key, and `set_automation_key` sets or clears a case’s automation key. Every tool operates inside the connection’s one workspace — the one you approved for an OAuth connection, or the API key’s — and respects the permissions of the person the connection belongs to. See the [MCP Server overview](https://testorchestrator.com/docs/mcp) to connect a client first.

> Most tools take a numeric `project` id. Start by calling `get_projects` to resolve a project name to its id, then use that id with the other tools; a project name is not accepted (see [Start with get_projects](https://testorchestrator.com/docs/mcp#start-with-get-projects)). Folder, field, tag, and source ids come from the discovery tools below.

## Discovery

Resolve names to ids and learn a project’s structure before reading or writing.

| Tool | What it does | Arguments |
| --- | --- | --- |
| `get_projects` | List the projects you can access (id + name) — use it to resolve a project name to an id. When you can access no project, the answer adds a `hint` that says whether this connection can make one with `create_project`. | _(none)_ |
| `get_folders` | List a project’s folders (id, name, parentId) so you can file cases in the right place. | `project` |
| `get_fields` | List a project’s templates and their fields (id, label, type incl. STEPS, options) — exactly what you see authoring a case. Use the field ids with `create_test_case`/`update_test_case` to set priority, steps, etc. | `project`, `templateId?` |
| `get_external_sources` | List a project’s integration sources (id, name, system type) and the available relation options. Use a source id + relation with `link_to_issue`. | `project` |
| `get_cycles` | List a project’s cycles (sprints/releases that group runs) and the available cycle types. Use a cycle id with run tools, and a cycle-type id with `create_cycle`. | `project` |
| `get_environments` | List the environments available in a project. Use an environment id as `environmentId` on run tools. | `project`, `context?` (`REPOSITORY` / `RUNS`) |
| `get_lifecycles` | List the workflow states available in a project. Use a state id as `lifecycleStateId` on case and run tools — the tool and parameter names still read `lifecycle`. | `project`, `context?` (`REPOSITORY` / `RUNS`) |
| `get_statuses` | List the result statuses for a project’s runs (id, name, whether each counts as pass/fail/complete). Use a status id with `record_test_result`. | `project` |
| `get_tags` | List the tags available in a project. Use tag ids with the `tagIds` argument on case and run tools. | `project`, `context?` (`REPOSITORY` / `RUNS`) |
| `get_users` | List the active users in the workspace (id, name, email, access level, global role) for assignee/identity resolution. **Requires user-management permission.** | _(none)_ |

## Projects

Create a project, so an assistant working in an empty workspace can set one up and go on to folders and cases.

| Tool | What it does | Arguments |
| --- | --- | --- |
| `create_project` | Create a project in the connection’s workspace, the same way **New project** does in the app: the same name rules, the same defaults and the same plan allowance. Returns `created`, the `project` (pass its id as `project` to `create_folder`, then `create_test_case`) and a `next` line. | `name` (+ `description?`) |

- **Who can call it.** Two things are needed: a connection that may make changes (the `mcp:write` scope; a personal API key always has it, a read-only OAuth connection is refused with HTTP 403 `insufficient_scope`), and an [access level](https://testorchestrator.com/docs/users-and-access/access-levels) that can create projects in the app — Tenant Admin or Project Admin. Anyone else gets `errorCode` `PROJECT_CREATE_NOT_ALLOWED` and nothing is created.
- **Calling it again with the same name does not make a second project.** If an active project with exactly that name already exists and you can see it, the answer is that project with `created` `false`, and `next` says that no second one was created.
- **At the plan’s project limit** the call is refused with `PLAN_QUOTA_EXCEEDED`, as in the app (see [Plan limits](https://testorchestrator.com/docs/mcp#plan-limits)).
- **`PROJECT_CREATE_BUSY`** means another project is being created in the same workspace at that moment. Nothing was created; call it again in a few seconds (see [Busy answers](https://testorchestrator.com/docs/mcp#busy-answers)).

## Test cases

List, search, create, and update test cases — including steps and priority through custom field values.

| Tool | What it does | Arguments |
| --- | --- | --- |
| `get_test_cases` | List test cases in a project, optionally limited to a folder. Returns each case’s id, title, status, and key fields — use `get_test_case` for one case in full. | `project`, `folder?` |
| `get_test_case` | Get one test case with full field values, including STEPS fields and their sub-fields. | `project`, `caseId` |
| `search_test_cases` | Keyword/filter search matching case title and number, cursor-paginated. Not semantic search. | `project`, `query?`, `folder?`, `limit?`, `cursor?` |
| `create_test_case` | Create a test case. Set steps and priority via `fieldValues` (discover field ids with `get_fields`); optionally link to an external issue on creation with `sourceReference` (with AI features on, that link gets an AI insight the same way as `link_to_issue`). Tags must already exist: pass `tagIds` from `get_tags`; this tool does not create tags. | `project`, `title`, `folder` (+ `templateId?`, `lifecycleStateId?`, `estimate?`, `tagIds?`, `fieldValues?`, `sourceReference?`) |
| `update_test_case` | Update an existing case’s fields — including steps and priority via `fieldValues`. Plain text sent to a text field that holds images is refused; see [Reading and editing a text field](https://testorchestrator.com/docs/mcp/tools#text-fields). | `project`, `caseId` (+ any of `title`, `folder`, `templateId`, `lifecycleStateId`, `estimate`, `tagIds`, `fieldValues`) |

> **Steps and priority via `fieldValues`.** Each entry is `{ fieldId, value }`, where `value` is the field’s JSON value — a string for selects like priority, or a structured value for a STEPS field. Call `get_fields` first to discover the right field ids, types, and options.

> **Reading and editing a text field.** `get_test_case`, `get_test_cases`, `search_test_cases` and `get_run_case_details` return three things for a TEXT field. `displayValue` is the text as a person reads it, with an image shown as `[image: file name]` — read this one. `renderedHtml` is the stored HTML. `value` is the stored value: plain text, or a rich-text document when the field holds formatting or images.
>
> To edit a field, send `value` back with your change, never `displayValue`. Plain text sent with `update_test_case` to a field that holds images is refused with `errorCode` `FIELD_IMAGES_WOULD_BE_REMOVED` and nothing is changed: send the document with its text changed to keep the images, or a document without an image to remove it.

## Folders

Build and reorganise the repository folder tree that test cases live in.

| Tool | What it does | Arguments |
| --- | --- | --- |
| `create_folder` | Create a repository folder. Returns the new folder id for use with `create_test_case`. Omit `parentId` for a top-level folder. | `project`, `name` (+ `parentId?`, `description?`) |
| `update_folder` | Rename, re-describe, or re-parent a folder. Only the provided fields change. | `project`, `folderId` (+ `name?`, `description?`, `parentId?`) |

## Comments

Read, add, edit, and remove comments on a test case — useful for an agent to leave or revise analysis.

| Tool | What it does | Arguments |
| --- | --- | --- |
| `add_comment` | Add a comment to a test case (for example, analysis or notes from an AI agent). | `project`, `caseId`, `comment` |
| `get_comments` | List the comments on a test case. | `project`, `caseId` |
| `update_comment` | Edit a comment’s text. You can edit your own; editing someone else’s needs elevated permission. | `project`, `caseId`, `commentId`, `comment` |
| `delete_comment` | Delete a comment. You can delete your own; deleting someone else’s needs elevated permission. | `project`, `caseId`, `commentId` |

## Test runs

Start runs, edit their case selection, record per-case results, read summaries, and close them out.

| Tool | What it does | Arguments |
| --- | --- | --- |
| `start_test_run` | Start a test run — by default it includes the project’s test cases, filtered by the test case workflow’s [include-in-runs states](https://testorchestrator.com/docs/workflows/automation#include-in-runs) when that set is non-empty. Optionally attach a cycle and environment. | `project` (+ `title?`, `includeAllCases?`, `cycleId?`, `environmentId?`) |
| `get_test_runs` | List the runs in a project (id, title, status, counts). Use `get_run_results` for a run’s folder-tree summary, and `get_run_case_details` for one case’s detail inside a run. | `project` |
| `get_run_results` | Results summary for a run — folder tree with pass/fail/complete counts and per-status tallies. This is an aggregate: it does not return one case’s steps. | `project`, `runId` |
| `get_run_case_details` | Get one case’s details inside a run, including its test steps (`steps[].position` is the step number), step sub-fields, each recorded result’s files, and what was recorded per step on the latest result — see [Per-step results](https://testorchestrator.com/docs/mcp/tools#step-results). This is the per-case detail tool. | `project`, `runId`, `caseId` (+ `resultId?`, `stepsFrom?`) |
| `record_test_result` | Record a result for one case in a run (e.g. Passed/Failed/Blocked). Get a `statusId` from `get_statuses`; Untested is not accepted. Optionally record each step’s status and note with `steps` — see [Per-step results](https://testorchestrator.com/docs/mcp/tools#step-results). | `project`, `runId`, `caseId`, `statusId` (+ `comment?`, `elapsedSeconds?`, `steps?`) |
| `update_test_run` | Edit a run’s title, notes, cycle, environment, workflow state, tags, and case selection. Closed runs can’t be edited. | `project`, `runId` (+ `title?`, `notes?`, `cycleId?`, `environmentId?`, `lifecycleStateId?`, `tagIds?`, and case selection: `includeAllCases?` / `caseIds?` / `addCaseIds?` + `removeCaseIds?`) |
| `close_test_run` | Close a run, marking it finished. As when you close a run in the app, this wakes the [Linear integration’s](https://testorchestrator.com/docs/integrations/linear) QA agent if a workspace admin has turned it on: it sends the run’s results to our AI provider and, with auto-actions on, can comment on, move or label the linked Linear issues. | `project`, `runId` |

### Per-step results

`record_test_result` takes an optional `steps` list, one entry per step, so a result can say which step failed and why:

- **`position`** — the step number, 1-based, as `get_run_case_details` returns it in `steps[].position`.
- **`statusId`** — the step’s status, any status `get_statuses` lists except Untested.
- **`comment`** (optional) — plain text, stored as the step’s note.

The arguments of a `record_test_result` call that marks three steps:

```json
{
  "project": 12,
  "runId": 345,
  "caseId": 678,
  "statusId": 2,
  "comment": "Checkout fails at payment",
  "steps": [
    { "position": 1, "statusId": 1 },
    { "position": 2, "statusId": 1 },
    { "position": 3, "statusId": 2, "comment": "The Pay button stays disabled" }
  ]
}
```

- **All or nothing.** If any entry is refused, nothing is recorded: a step number the case does not have (`STEP_NOT_FOUND`), a status that cannot be recorded on a step, Untested included (`STEP_STATUS_INVALID`), or a malformed entry such as a step listed twice (JSON-RPC `-32602`).
- **Only the steps you list are stored.** A step you leave out stays unmarked and nothing is stored for it, as when a tester marks only some steps in the app. Without `steps`, or with an empty list, no step is stored at all.
- The answer adds `recordedSteps`: each stored step’s `position`, `statusId`, `status`, `statusName` and `comment`. The marks and notes show in the result’s [history entry](https://testorchestrator.com/docs/test-runs/recording-results#history-step-marks) in the app.

`get_run_case_details` reads them back. Under `results`, the latest result carries `steps`: every step that has a mark, a note or an image, with its `position`, `status`, `statusId` and `statusName`, `comment` (the note as plain text) and `files` (the images attached to that step). Every other result carries only `stepCount`; pass its `resultId` to get its steps instead.

- **Long notes are shortened.** A shortened comment ends with “…” and carries `commentTruncated` `true`; asking for one result by `resultId` returns longer comments.
- **Long step lists come in pages.** When the steps block is cut, the result carries `stepsTruncated` `true`, `stepsOmitted` and `nextStepsFrom`; call again with `stepsFrom` set to `nextStepsFrom` (and the same `resultId`, if you passed one) to read the rest.

## Cycles

Create and manage the cycles (sprints/releases) that group test runs. Discover existing cycles and cycle types with `get_cycles`.

| Tool | What it does | Arguments |
| --- | --- | --- |
| `create_cycle` | Create a cycle. Set `status` `ACTIVE` (with a start date) to start it, or `COMPLETED` (with an end date) to complete it; nest it with `parentCycleId`. | `project`, `name`, `cycleTypeId` (+ `description?`, `startDate?`, `endDate?`, `status?`, `parentCycleId?`) |
| `update_cycle` | Update a cycle’s name, dates, type, status, or parent. Only the provided fields change; `clearParent` detaches its parent. | `project`, `cycleId` (+ `name?`, `description?`, `cycleTypeId?`, `startDate?`, `endDate?`, `status?`, `parentCycleId?`, `clearParent?`) |
| `reopen_cycle` | Reopen a completed cycle (back to `ACTIVE`, clearing its end date). Only a completed cycle can be reopened. | `project`, `cycleId` |

## Attachments

Upload a file (a screenshot or document) and attach it to a test case field or step, a test run result, or an exploratory session result. Uploading is a **two-step flow**: call `prepare_attachment_upload` to get a presigned URL, `PUT` the file bytes to that URL yourself (a plain HTTP request, outside MCP), then call `create_attachment_from_upload` with the returned `fileKey` to finalise the attachment.

| Tool | What it does | Arguments |
| --- | --- | --- |
| `prepare_attachment_upload` | Start an upload. Returns a presigned upload URL (PUT the file bytes to it) and a `fileKey` to pass to `create_attachment_from_upload`. Validates the target exists, applies your project permissions, and reserves storage quota. | `objectType`, `project`, `fileName`, `contentType`, `fileSize` (+ target ids below) |
| `create_attachment_from_upload` | Finalise the upload started above: pass the same target plus the `fileKey`. Links the file to the object and, for rich-text fields, notes, and steps, embeds it inline so it renders like a manually uploaded attachment. | `objectType`, `project`, `fileName`, `contentType`, `fileSize`, `fileKey` (+ target ids below) |

> **Targeting the attachment.** `objectType` is `TEST_CASE`, `TEST_RUN_RESULT`, or `TEST_SESSION_RESULT`. Supply the ids that match it, all alongside the required `project`, `fileName`, `contentType`, and `fileSize`:
>
> - **TEST_CASE** — `testCaseId` and `fieldId` (from `get_fields`): a TEXT field of the case’s template, or its STEPS field together with `stepPosition`; other field types are refused. The image is embedded in that field, so a TEXT field that held plain text then holds a rich-text document with the same text. For a STEPS field, `stepPosition` selects the step (1-based) and `stepField` the sub-cell (`step_1`=Step, `step_2`=Data, `step_3`=Expected, `step_4`=Notes; defaults to `step_3`).
> - **TEST_RUN_RESULT** — `runId` and `resultId`. Add `stepPosition` to put the image in that step’s note on a result you recorded; `get_run_case_details` then lists it under that step (`results[].steps[].files`), not in `results[].files`. Or set `inline` `true` to embed the image in the result’s notes (default attaches it as a result-level file).
> - **TEST_SESSION_RESULT** — `sessionId` and `resultId`.
>
> `stepPosition` is the step number `get_run_case_details` returns in `steps[].position`. The older `stepIndex` is still accepted and is zero-based, so `stepIndex` 0 is step 1. Sending both is refused when they name different steps; send only `stepPosition`.

**Images in rich text.** Rich text keeps only images stored in TestOrchestrator. An image whose address is anywhere else — another site, another TestOrchestrator environment — is removed when the text is saved, through any tool, and the text around it is kept; the tool’s answer then ends with a note that an image was not kept. To include an image, upload it with `prepare_attachment_upload` and `create_attachment_from_upload`.

## Traceability

Link cases to external issues and read coverage and reverse traceability.

| Tool | What it does | Arguments |
| --- | --- | --- |
| `link_to_issue` | Link a test case to an external issue (e.g. a Linear or Jira issue) for traceability. This writes the link in TestOrchestrator only; it does not modify the external tracker. When AI features are on for the workspace, TestOrchestrator then reads the issue from the connected tracker and sends it with the case to our AI provider to write the link’s AI insight, as linking in the app does. In a project with no issue tracker source enabled the call is refused with `errorCode` `NO_ISSUE_TRACKER_SOURCE`: a workspace admin adds a source or connects a tracker in the app; it cannot be done with these tools. | `project`, `caseId`, `sourceId`, `issueKey` (+ `relationType?`, `issueUrl?`, `title?`) |
| `get_cases_for_issue` | Reverse traceability: the test cases referencing a given external issue. Needs _View external references_: it looks only in projects where you have it, and is refused if you have it in none. | `sourceId`, `issueKey` |
| `get_coverage_gaps` | Per object type, how many objects are not yet linked to any external issue — the traceability gap. | `project`, `sourceId?` |

## Errors & permissions

Resources you can’t see are reported as _“not found or access denied”_ — the same message whether the resource is missing or simply outside your access, so it never reveals what exists in another workspace. Read tools work for anyone who can see the project, but the write tools (creating projects, creating or updating cases, folders, comments, runs, results, cycles, attachments, and links) require the same permissions they need in the app, so some calls may be denied; an OAuth connection approved read-only cannot call them at all (HTTP 403 `insufficient_scope`). A few tools have extra gates: `get_users` needs user-management permission, `get_cases_for_issue` needs _View external references_, and editing or deleting _someone else’s_ comment needs elevated permission. Tool failures come back as a result with `isError: true` — at a plan limit with `errorCode` `PLAN_QUOTA_EXCEEDED` (see [Plan limits](https://testorchestrator.com/docs/mcp#plan-limits)); malformed arguments return JSON-RPC `-32602`. `create_project` needs an access level that can create projects (`PROJECT_CREATE_NOT_ALLOWED` otherwise). `RESULT_BUSY`, `SERVER_BUSY` and `PROJECT_CREATE_BUSY` are “try again in a moment” answers — see [Busy answers](https://testorchestrator.com/docs/mcp#busy-answers).

## Related

- [MCP Server overview](https://testorchestrator.com/docs/mcp) — Connect Claude, Claude Code, Cursor or VS Code by signing in with OAuth, or with an API key, and the act-as-you security model.
- [Link types](https://testorchestrator.com/docs/integrations/relations) — The semantic labels applied to external links (called relations in the API) — the relation values `link_to_issue` accepts.
