Skip to main content
Glama

Prepare attachment upload

prepare_attachment_upload

Start an attachment upload for a test case field/step, a test run result, or an exploratory session result. Returns a presigned upload URL (PUT the file bytes to it) and a fileKey to pass to create_attachment_from_upload. objectType is TEST_CASE | TEST_RUN_RESULT | TEST_SESSION_RESULT.

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": {
      "objectType": "<objectType>",
      "project": "<project>",
      "fileName": "<fileName>",
      "contentType": "<contentType>",
      "fileSize": "<fileSize>"
    },
    "name": "prepare_attachment_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
runIdNoTEST_RUN_RESULT: the test run id.
inlineNoTEST_RUN_RESULT only: true embeds the image inline in the result's notes/comment; false (default) attaches it as a result file. Ignored when a step is named.
fieldIdNoRich-text field id (from get_fields). TEST_CASE: required - 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's rich text, so a TEXT field that held plain text then holds a rich-text document with the same text (displayValue shows both). TEST_RUN_RESULT: optional, a TEXT result field such as "Actual Result".
projectYesProject id the object belongs to. Numeric project id as returned by get_projects (the number in the app URL); a project name is not accepted.
fileNameYesOriginal file name.
fileSizeYesFile size in bytes.
resultIdNoTEST_RUN_RESULT / TEST_SESSION_RESULT: the result id.
sessionIdNoTEST_SESSION_RESULT: the exploratory session id.
stepFieldNoTEST_CASE STEPS field only: sub-cell to embed into (step_1=Step, step_2=Data, step_3=Expected, step_4=Notes). Defaults to step_3.
stepIndexNoOlder form of stepPosition: the zero-based step, so stepIndex 0 is step 1 (stepPosition = stepIndex + 1). If both are given they must name the same step.
objectTypeYesTarget object type.
testCaseIdNoTEST_CASE: the test case id (required for TEST_CASE).
contentTypeYesMIME type, e.g. image/png.
stepPositionNoStep number, 1-based, as get_run_case_details returns it in steps[].position. TEST_CASE STEPS field: the step row to embed into. TEST_RUN_RESULT: the step whose note gets the image; it is listed under that step in get_run_case_details (results[].steps[].files), not in results[].files. Omit for a result-level file.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / fieldId / description
      Previous value: -"Rich-text field id (from get_fields). TEST_CASE: required - 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's rich text, so a TEXT field that held plain text then holds a rich-text document with the same text (renderedHtml shows both). TEST_RUN_RESULT: optional, a TEXT result field such as \"Actual Result\"."New value: +"Rich-text field id (from get_fields). TEST_CASE: required - 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's rich text, so a TEXT field that held plain text then holds a rich-text document with the same text (displayValue shows both). TEST_RUN_RESULT: optional, a TEXT result field such as \"Actual Result\"."
    • changedInput schema / properties / project / description
      Previous value: -"Project id the object belongs to. Numeric id from get_projects (same as in the app URL); not the project name."New value: +"Project id the object belongs to. Numeric project id as returned by get_projects (the number in the app URL); a project name is not accepted."
  2. Changed2 schema fields changed
    • changedInput schema / properties / fieldId / description
      Previous value: -"Rich-text field id (from get_fields). TEST_CASE: a case field or the STEPS field. TEST_RUN_RESULT: a result field such as \"Actual Result\"."New value: +"Rich-text field id (from get_fields). TEST_CASE: required - 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's rich text, so a TEXT field that held plain text then holds a rich-text document with the same text (renderedHtml shows both). TEST_RUN_RESULT: optional, a TEXT result field such as \"Actual Result\"."
    • changedInput schema / properties / testCaseId / description
      Previous value: -"TEST_CASE: the test case id."New value: +"TEST_CASE: the test case id (required for TEST_CASE)."
  3. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false and destructiveHint=false. The description adds real context beyond that: this call does not upload bytes itself but mints a presigned URL, and it produces a fileKey consumed by another tool. It omits URL lifetime, permission requirements, and whether abandoned uploads leave state, which is the remaining gap.

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?

Three sentences, front-loaded with purpose, then return values, then the conditional enum. Tight and free of filler, though the trailing objectType sentence partially duplicates the schema enum.

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?

No output schema exists, so the description correctly explains what is returned (presigned URL and fileKey) and how to use each. For a 14-parameter tool with fully documented schema, this is nearly complete; only presigned-URL expiry and any authorization prerequisites are 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 coverage is 100% and the parameter descriptions are unusually rich (conditional requirements per objectType, stepIndex vs stepPosition equivalence). The description only restates the objectType enum values, adding little beyond the schema, 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?

The opening sentence uses a specific verb plus resource ('Start an attachment upload') and enumerates the three target object types, which distinguishes it clearly from siblings like create_attachment_from_upload or add_comment.

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?

It describes the two-step workflow (PUT bytes to the returned URL, then pass fileKey to create_attachment_from_upload), which tells the agent when this tool must be used as a precursor. It stops short of explicit when-not-to-use or prerequisite/precondition statements.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.