Skip to main content
Glama

Create attachment upload url

create_attachment_upload_url

Upload a file to FeatureOS storage, or get a presigned URL to upload it yourself.

Two kinds of upload:

  • Editor image (resource_type set): a jpg/jpeg/png/gif to embed in an article, changelog, post or comment body. file_url is a public URL.

  • File custom field (resource_type omitted): any file for a file-type custom field. Requires the custom fields power-up.

Two ways to send the bytes:

  • content_base64 (files up to 1 MB): the server uploads the file in this same call. No outbound network needed on your side. Use this from a sandbox that cannot reach the storage host.

  • Presigned PUT (any size up to the org limit): pass file_size, then run the returned curl_command (a plain HTTP PUT with exactly the signed headers - Content-Length, and Content-Type for images). Callers that cannot reach the storage host should use content_base64 for files up to 1 MB.

Then use file_url. Editor image: embed <img src="{file_url}"> in the description/body HTML of create/update_article, create/update_changelog, create/update_feature_request or create/update_comment. Custom field: pass file_url as the field's value, e.g. create_feature_request(custom_fields={"<field_slug>": file_url}).

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": {
      "filename": "<filename>"
    },
    "name": "create_attachment_upload_url"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameYesName of the file to upload, e.g. 'spec.pdf' or 'screenshot.png'. Used to derive the file extension.
file_sizeNoExact size of the file in bytes. The URL is signed against this size, so an upload of any other size is rejected. Required unless content_base64 is given.
for_resourceNoCustom field uploads only (ignored when resource_type is set): what the file custom field belongs to, 'feature_request' (post fields, default), 'survey', or 'user'.feature_request
resource_typeNoSet to upload an image to embed in that resource's HTML body: 'article', 'changelog', 'feature_request' (post), or 'comment'. jpg, jpeg, png or gif only. Omit for a file custom field upload.
content_base64NoOptional: the file's bytes, base64-encoded (a 'data:...;base64,' prefix is fine). Max 1 MB decoded. When given, the server uploads the file itself and returns the ready file_url - use this when you cannot make outbound HTTP requests. Omit for larger files and upload with the returned curl_command instead.

Output Schema

NameRequiredDescriptionDefault
uploadNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only say this is a non-read-only, open-world, non-destructive call; the description adds far more: the 1 MB base64 ceiling, org size limits, the requirement to send exactly the signed headers (Content-Length, Content-Type for images), the custom-fields power-up prerequisite, and the fact that the server performs the upload in the base64 path. Minor gap: it does not state whether uploads are idempotent or what happens on a retried PUT.

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 and structured into labeled bullet groups (kinds of upload, ways to send bytes, then-use guidance), which suits a tool with two orthogonal modes. It loses a point for repeating the 'callers that cannot reach the storage host should use content_base64 up to 1 MB' rule twice.

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?

Given five parameters, two operating modes, and an existing output schema, the description covers everything an agent needs: mode selection, size limits, transport constraints, and downstream usage of the returned file_url. Return-value documentation is correctly left to the output 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%, so the baseline is 3; the description earns more by explaining cross-parameter relationships the schema only hints at — resource_type set means image-only public URL, omitted means custom-field upload, and file_size is only meaningful in the presigned path. It also clarifies that Content-Type is required only for images.

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?

Opens with a specific verb and resource: upload a file to FeatureOS storage or obtain a presigned URL to upload it yourself. It then splits the tool into its two real modes (editor image with resource_type vs file custom field without), which lets an agent distinguish this tool from every create_*/get_* sibling immediately.

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: use content_base64 for files up to 1 MB when the caller cannot reach the storage host, use the presigned PUT for anything larger up to the org limit. It also states the prerequisite (custom fields power-up) and spells out the follow-on step, naming the exact sibling tools (create_article, update_changelog, create_feature_request, create_comment) where file_url is consumed.

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.