Skip to main content
Glama

Upload File Attachment

upload_file

Attach logs, screenshots, or patches to an existing MantisBT issue using a local file path or Base64 content. Returns attachment metadata without changing 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 list_issue_files. To retrieve issue details, use get_issue.

Input Schema

TableJSON 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.8/5.0
Behavior5/5

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

Annotations only declare write/idempotent/destructive hints; the description adds substantially more: it discloses that no issue fields or status are touched, that it returns created attachment metadata, and that file_path reads from the server filesystem and is disabled over HTTP unless MANTIS_UPLOAD_DIR is set. This transport/permission context goes well beyond the annotations.

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?

Well front-loaded: purpose first, then the two input modes as structured bullets, then optional fields, then routing to siblings. Slightly long, and filename derivation is stated in both the file_path bullet and the filename param, but the length is justified by the mode-selection complexity.

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 6-param write tool with no output schema, the description covers the critical unknowns: mode selection, defaults, server-vs-HTTP transport limitations, and confirmation that attachment metadata 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 the baseline is 3, but the description still adds real meaning: mutual exclusivity of file_path vs content, when content_type defaults, how filename is derived or overridden, and that content is base64. This maps modes and defaults that the schema only states declaratively.

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?

Starts with a specific verb+resource (upload/attach a file to a MantisBT issue) and immediately scopes behavior, stating it adds the file without modifying issue fields or status. Distinguishes itself from siblings list_issue_files and get_issue explicitly by name.

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, actionable selection rules: 'Provide exactly one of the two input modes,' marks file_path as preferred when the file is on disk, and restricts content to in-memory cases. Names the alternatives (list_issue_files, get_issue) for adjacent tasks.

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