Skip to main content
Glama

Upload File Attachment

upload_file

Attach logs, screenshots, or patches to an existing MantisBT issue by providing a local file path or Base64 content; returns attachment metadata without altering issue fields.

Instructions

Upload a file as an attachment to a MantisBT issue. Adds the file to the issue without modifying any issue fields or status. Returns the created attachment metadata on success.

Provide exactly one of the two input modes:

  • file_path (preferred): absolute path to a local file — use this whenever the file exists on disk; the server reads and encodes it automatically; filename is derived from the path. Note: file_path reads from the server's filesystem and is disabled over the HTTP transport unless MANTIS_UPLOAD_DIR is configured — HTTP clients should use content instead.

  • content: Base64-encoded file content — only use this when the file is not accessible via a path (e.g. in-memory data); filename must be supplied explicitly via the filename parameter

The optional content_type sets the MIME type (e.g. "image/png"); defaults to "application/octet-stream". Use the optional description to annotate the attachment.

Use this tool to attach files such as logs, screenshots, or patches to an existing issue. To list existing attachments, use get_issue with select: "attachments".

Input Schema

NameRequiredDescriptionDefault
contentNoFallback: Base64-encoded file content — only use when file_path is not available (mutually exclusive with file_path)
filenameNoFile name for the attachment (required when using content; overrides the derived name when using file_path)
issue_idYesNumeric issue ID
file_pathNoPreferred: absolute path to the local file to upload — use this whenever the file exists on disk (mutually exclusive with content)
descriptionNoOptional description for the attachment
content_typeNoMIME type of the file, e.g. "image/png" (default: "application/octet-stream")

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.14.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / issue_id / maximum
      Added value: +9007199254740991
  2. Addedv1.10.4
  3. Removed
  4. Changed9 schema fields changedv1.8.1
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / content
      Added value: +{
      +  "description": "Base64-encoded file content (mutually exclusive with file_path)",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / content_type
      Added value: +{
      +  "description": "MIME type of the file, e.g. \"image/png\" (default: \"application/octet-stream\")",
      +  "type": "string"
      +}
    • addedInput schema / properties / description
      Added value: +{
      +  "description": "Optional description for the attachment",
      +  "type": "string"
      +}
    • addedInput schema / properties / file_path
      Added value: +{
      +  "description": "Absolute path to the local file to upload (mutually exclusive with content)",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / filename
      Added value: +{
      +  "description": "File name for the attachment (required when using content; overrides the derived name when using file_path)",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / issue_id
      Added value: +{
      +  "description": "Numeric issue ID",
      +  "exclusiveMinimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / required
      Added value: +[
      +  "issue_id"
      +]
  5. First observedv1.5.6

TDQS

A4.6/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false, idempotentHint=false, destructiveHint=false, so the safety profile is already covered; the description adds that issue fields/status are untouched and that metadata is returned on success. The server-side filesystem read and its HTTP-transport restriction plus the MANTIS_UPLOAD_DIR configuration requirement are genuinely valuable context not in the annotations. Minor gap: it doesn't warn about duplicate uploads on retry (consistent with idempotentHint=false) or size limits.

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?

Front-loaded with purpose, side-effect scope, and return value, then a clean two-mode block followed by the alternative tool. It is somewhat verbose — the file_path bullet packs transport, config, and naming concerns into one dense sentence — but nearly every clause carries information an agent needs.

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 six-parameter mutation tool with no output schema, the description covers the required issue_id context, both input modes and their exclusivity, filename handling, MIME defaults, and what is returned. Nothing an agent needs to call it correctly is missing.

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%, so baseline is 3; the description earns an extra point by explaining filename derivation from file_path and the override behavior, the content_type default, and the mutual exclusivity of the two input modes. Some of this duplicates schema text ('Preferred', 'Fallback', 'mutually exclusive'), so it is additive rather than transformative.

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 ('Upload a file as an attachment to a MantisBT issue') and immediately scopes the side effect ('without modifying any issue fields or status'). It also distinguishes itself from sibling read/list tools by naming get_issue with select: "attachments" as the way to enumerate attachments.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit decision rules: file_path is preferred whenever the file exists on disk, content is the fallback for in-memory data, and exactly one must be supplied. It also names the alternative tool for listing attachments and flags that file_path is unavailable over HTTP transport unless MANTIS_UPLOAD_DIR is configured.

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