Skip to main content
Glama
uarlouski

TestRail MCP Server

by uarlouski

query_attachment

Read-onlyIdempotent

Download one TestRail attachment or list all attachments for a test case or test run. Use action 'one' or 'many' to choose the operation.

Instructions

Download a single attachment or list all attachments for a test case or test run in TestRail. Set payload.action to 'one' or 'many' to specify the operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
payloadYesThe payload containing the action ('one' or 'many') and corresponding parameters

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.9.0
    • changedInput schema / properties / payload / oneOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "action": {
      -        "const": "one",
      -        "description": "Download a single attachment by ID and save to local filesystem",
      -        "type": "string"
      -      },
      -      "attachment_id": {
      -        "anyOf": [
      -          {
      -            "type": "number"
      -          },
      -          {
      -            "type": "string"
      -          }
      -        ],
      -        "description": "The ID of the attachment to download (numeric ID or UUID)"
      -      },
      -      "output_file": {
      -        "description": "Absolute local file path where the downloaded attachment will be saved",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "action",
      -      "attachment_id",
      -      "output_file"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "action": {
      -        "const": "many",
      -        "description": "Retrieve attachment metadata for a test case or test run",
      -        "type": "string"
      -      },
      -      "entity_id": {
      -        "anyOf": [
      -          {
      -            "type": "number"
      -          },
      -          {
      -            "type": "string"
      -          }
      -        ],
      -        "description": "The ID of the entity (e.g. 123 or 'C123' for cases, or numeric run ID)"
      -      },
      -      "entity_type": {
      -        "description": "The type of entity to get attachments for ('case' or 'run')",
      -        "enum": [
      -          "case",
      -          "run"
      -        ],
      -        "type": "string"
      -      },
      -      "output_file": {
      -        "description": "Optional absolute file path to export large metadata JSON responses",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "action",
      -      "entity_type",
      -      "entity_id"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "action": {
      +        "const": "one",
      +        "description": "Download a single attachment by ID and save to local filesystem",
      +        "type": "string"
      +      },
      +      "attachment_id": {
      +        "description": "The ID of the attachment to download (numeric ID or UUID)",
      +        "type": [
      +          "number",
      +          "string"
      +        ]
      +      },
      +      "output_file": {
      +        "description": "Absolute local file path where the downloaded attachment will be saved",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "action",
      +      "attachment_id",
      +      "output_file"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "action": {
      +        "const": "many",
      +        "description": "Retrieve attachment metadata for a test case or test run",
      +        "type": "string"
      +      },
      +      "entity_id": {
      +        "description": "The ID of the entity (e.g. 123 or 'C123' for cases, or numeric run ID)",
      +        "type": [
      +          "number",
      +          "string"
      +        ]
      +      },
      +      "entity_type": {
      +        "description": "The type of entity to get attachments for ('case' or 'run')",
      +        "enum": [
      +          "case",
      +          "run"
      +        ],
      +        "type": "string"
      +      },
      +      "output_file": {
      +        "description": "Optional absolute file path to export large metadata JSON responses",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "action",
      +      "entity_type",
      +      "entity_id"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Addedv2.3.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true and destructiveHint=false, so the safety profile is covered. The description adds only the two operating modes, which the schema already describes; it does not mention that the 'one' mode writes to the local filesystem or any permission/size constraints. Modest added context, hence a 3.

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?

Two tight sentences, front-loaded with the operation and followed by the mode selector. No wasted clauses, though the second sentence largely duplicates what the schema's const enums already convey.

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?

With no output schema, the description adequately signals the two outcomes (downloaded file vs. attachment list) and the mode discriminator. Annotations cover the safety profile. It stops short of noting where downloads land or what the list contains, but nothing essential to calling it correctly is missing.

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 the schema already documents action, attachment_id, entity_type, entity_id and output_file in detail. The description only restates the action discriminator values that the schema already fixates as consts, adding no format or semantics beyond it. Baseline 3 applies.

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 description states specific verbs and resource: 'Download a single attachment or list all attachments for a test case or test run in TestRail.' This cleanly contrasts with the sibling add_attachment, though it never names or explicitly excludes it. An agent can identify the operation without opening the schema.

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?

It explains how to select the operation ('set payload.action to one or many') but gives no guidance on when to prefer one mode over the other, nor any exclusions relative to siblings like add_attachment. Usage is implied by the enum values rather than stated as guidance.

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