Skip to main content
Glama
postgresai

postgresai

Official

upload_file

Uploads a local file to PostgresAI storage and returns its storage URL plus a ready-to-paste markdown link for use in issues or comments.

Instructions

Upload a local file to PostgresAI storage. Returns the storage URL and a ready-to-paste markdown link (image extensions get the inline ![](url) form, others get [](url)). For posting attachments alongside an issue or comment, prefer the 'attachments' parameter on the issue/comment tools — this tool is for ad-hoc uploads or when you need the URL out of band.

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": {
      "path": "<path>"
    },
    "name": "upload_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesLocal file path to upload (absolute or relative to CWD)
debugNoEnable verbose debug logs
org_idNoOrganization ID. Optional with a per-organization token (uses the stored org); REQUIRED with a global token, which can reach every organization the user belongs to and will not assume one. Use orgs_list / `pgai orgs` to discover valid values.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden, and it does disclose the return contract (storage URL plus a markdown link, with the inline image form called out). It says nothing about upload size limits, permission or visibility of the stored file, whether an existing file is overwritten, or error behavior — real gaps for a write operation with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, nothing redundant: purpose first, return contract second, routing guidance last. The parenthetical about image extensions is dense but earns its place by preventing a formatting mistake.

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?

With no annotations and no output schema, the description compensates well by explaining the return value and the preferred alternative path. It is only slightly short of complete, missing operational bounds (size limits, auth prerequisites, overwrite semantics) that an agent would need before calling it blindly.

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 description coverage is 100%, and the schema already explains path resolution and the global-vs-per-organization token rule for org_id, so the baseline of 3 applies. The description adds no additional meaning about any of the three parameters beyond what the schema states.

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 first sentence names a specific verb and resource plus the destination ('Upload a local file to PostgresAI storage'), which is immediately distinguishable from download_file and the read/list siblings. The second sentence adds what the tool produces, so an agent knows exactly what it gets back.

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?

It explicitly routes the agent away from this tool in the common case ('For posting attachments alongside an issue or comment, prefer the "attachments" parameter on the issue/comment tools') and defines the remaining niche ('ad-hoc uploads or when you need the URL out of band'). Both the when-not and the when are stated, with a concrete alternative.

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