Skip to main content
Glama

Attach uploaded file

create_attachment_from_upload

Finalise an attachment upload started with prepare_attachment_upload: pass the same target (objectType + ids + field/step) plus the fileKey, fileName, contentType and fileSize. Links the file to the object; for a rich-text field, a test-case step, the result comment (inline) or a run-result step (stepPosition) it also embeds the image inline. A run-result step image is listed under that step in get_run_case_details (results[].steps[].files); a result-level file is listed in results[].files. RESULT_BUSY means nothing was attached; the same call can be repeated after a few seconds.

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>",
      "fileKey": "<fileKey>"
    },
    "name": "create_attachment_from_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".
fileKeyYesThe fileKey returned by prepare_attachment_upload.
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.6/5.0
Behavior5/5

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

Annotations already declare a non-read-only, non-destructive, non-idempotent write; the description adds substantially beyond that: the write is a link/association, inline embedding only occurs for specific targets (rich-text field, test-case step, result comment, run-result step), and it names exactly where the artifact becomes visible afterwards (results[].steps[].files vs results[].files). The RESULT_BUSY contract — 'nothing was attached; the same call can be repeated after a few seconds' — is precisely the retry semantics an agent needs and is not implied by idempotentHint=false.

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 the action and its prerequisite, then the effect, then the error contract — sensible ordering with no filler. It is dense for a 15-parameter tool, though the middle sentence packs several target variants into one long clause that costs a little readability.

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 15-parameter branching mutation with no output schema, the description supplies what the structured fields cannot: the prepare/finalise sequence, the inline-vs-file outcome per object type, the post-call verification path, and the one retryable error code. An agent can chain prepare → create → verify → retry on RESULT_BUSY using only this text plus the schema.

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

Parameters4/5

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

Schema coverage is 100% and the per-parameter descriptions are already exhaustive (enums, 1-based vs 0-based step semantics, field-type restrictions), so the baseline is 3. The description earns above baseline by adding cross-parameter coupling the schema cannot express: the target fields must match what was passed to prepare_attachment_upload, and the field/step choice determines whether the image is embedded inline or listed at result level.

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 ('Finalise an attachment upload') and immediately names the sibling that starts the flow ('started with prepare_attachment_upload'), so the agent can place this tool in a two-step sequence without opening any schema. It further scopes the effect ('Links the file to the object') and enumerates the cases where inline embedding happens.

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 prerequisite is explicit: this is the second half of prepare_attachment_upload and must reuse 'the same target (objectType + ids + field/step) plus the fileKey...'. That is clear when-to-use guidance tied to a named sibling. It stops short of 5 because it never says what not to do (e.g. when to use add_comment or a different attach path instead, or what happens if you call it before preparing).

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.