Skip to main content
Glama

Prepare a file upload

prepare_file_upload

Get an upload destination for a file your shell transfers directly.

Use this to keep a file out of the context window. Call the tool, run
upload_command against the local file, then pass the returned reference
to the consuming tool.

Attach the file by passing s3_url to create_project or update_project as
documents[].s3_url. For external_findings on a project with several
repositories, add documents[].repo_slug. Every later scan reads attached
findings.

Uploading again under the same file_name stores a new version. Attaching
it replaces the attached version, and the reply says so.

Use document_name for security_advisor content_document and get_artifact
design_doc.

The file is stored under document_type, and the attaching tools read the
type from s3_url. Do not upload source code as a document. Connect its
repository through create_project's github_repo.

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": {
      "file_name": "<file_name>",
      "document_type": "<document_type>"
    },
    "name": "prepare_file_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
digestNoOptional content digest as 'sha256:<64 hex chars>' (compute with sha256sum). When it matches an already-stored version the upload is skipped and the existing location returned.
file_nameYesStored document name. Allowed characters are letters, digits, hyphens, underscores, and periods.
document_typeYes'design_doc' for design docs, specs, or plans; 'external_findings' for SARIF, Semgrep, or Snyk output, or a CSV export (DAST, pentest, vulnerability management), from the customer's scanners. Do not upload source code as a document; connect its repository with github_repo.
document_formatNoFile format. design_doc: md or pdf; external_findings: sarif, semgrep_json, snyk_json, or csv. Leave it out for a file named .csv, .sarif, .md or .pdf: the format is taken from the name. Required for .json files, which name no format.

Output Schema

NameRequiredDescriptionDefault
errorNoTrue when the call itself failed. False for successful calls, including a scan still running, an already approved plan, or a repository classified as non-agentic. The reason field describes these workflow states.
reasonNoA stable snake_case code from the allowed set. Present on every error and on successful calls that carry a workflow state.
s3_urlNoStable document location. Pass this as the document reference to create_project or update_project documents[].s3_url.
messageNoExactly one sentence written for the user. Never raw exception text or a backend error string, which may expose private details.
metadataNoCaller metadata, such as 'expiration_warning'. Substantive results have their own fields. Never includes exception or backend error text, which may expose private details.
expires_atNoISO timestamp when the upload_url stops working.
next_stepsNoRecommended next actions, in order.
upload_urlNoPresigned PUT URL for the file bytes. None when skipped_upload is true because Trent already stores identical content.
content_typeNoContent-Type header to send with the PUT.
document_nameNoStored document name, for security_advisor content_document and get_artifact design_doc.
max_size_bytesNoServer-enforced maximum file size for this document type.
skipped_uploadNoTrue when the digest matched a stored version. The file is already available at s3_url, so use that reference directly.
upload_commandNoReady-to-run shell command template for the transfer; replace <local-file-path> with the file to upload.
document_versionNoVersion number assigned to this upload.
retry_after_secondsNoWith reason rate_limited, how many seconds Trent asks the caller to wait.
max_scan_total_bytesNoFor external_findings, the most findings-file bytes one scan reads across all the project's attached files. Files past it are skipped for that scan. Null for other document types.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / document_format / anyOf
      Added value: +[
      +  {
      +    "enum": [
      +      "md",
      +      "pdf",
      +      "sarif",
      +      "semgrep_json",
      +      "snyk_json",
      +      "csv"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / document_format / default
      Added value: +null
    • changedInput schema / properties / document_format / description
      Previous value: -"File format. design_doc: md or pdf; external_findings: sarif, semgrep_json, or snyk_json."New value: +"File format. design_doc: md or pdf; external_findings: sarif, semgrep_json, snyk_json, or csv. Leave it out for a file named .csv, .sarif, .md or .pdf: the format is taken from the name. Required for .json files, which name no format."
    • removedInput schema / properties / document_format / enum
      Removed value: -[
      -  "md",
      -  "pdf",
      -  "sarif",
      -  "semgrep_json",
      -  "snyk_json"
      -]
    • removedInput schema / properties / document_format / type
      Removed value: -"string"
    • changedInput schema / properties / document_type / description
      Previous value: -"'design_doc' for design docs, specs, or plans; 'external_findings' for SARIF, Semgrep, or Snyk output from the customer's scanners. Do not upload source code as a document; connect its repository with github_repo."New value: +"'design_doc' for design docs, specs, or plans; 'external_findings' for SARIF, Semgrep, or Snyk output, or a CSV export (DAST, pentest, vulnerability management), from the customer's scanners. Do not upload source code as a document; connect its repository with github_repo."
    • changedInput schema / required
      Previous value: -[
      -  "file_name",
      -  "document_type",
      -  "document_format"
      -]New value: +[
      +  "file_name",
      +  "document_type"
      +]
  2. Changed2 schema fields changed
    • addedOutput schema / properties / max_scan_total_bytes
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "For external_findings, the most findings-file bytes one scan reads across all the project's attached files. Files past it are skipped for that scan. Null for other document types.",
      +  "title": "Max Scan Total Bytes"
      +}
    • addedOutput schema / properties / retry_after_seconds
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "With reason rate_limited, how many seconds Trent asks the caller to wait.",
      +  "title": "Retry After Seconds"
      +}
  3. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false and idempotentHint=false, and the description explains the resulting state effects: re-uploading under the same file_name stores a new version, attaching replaces the attached version, and later scans read attached findings. This adds real value beyond the annotations, though permissions/auth requirements and the digest-skip interaction with versioning are left to the schema.

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 the purpose in the first line, then short paragraphs each covering a distinct concern (workflow, attachment, versioning, consumer-specific naming, restriction). A couple of lines such as the document_name sentence are terse enough to be ambiguous, and the source-code restriction duplicates the schema, so it is not maximally tight.

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?

For a 4-parameter tool with a full output schema and complete parameter descriptions, the description covers workflow, downstream consumption, versioning, and the main misuse case. The only gap is the relationship between the digest short-circuit and the stated new-version behavior, which an agent must infer from 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%, so the baseline is 3, but the description adds cross-tool meaning: document_type governs storage and the attaching tools read the type from s3_url, and it maps document_name usage to security_advisor content_document and get_artifact design_doc. It does not explain digest or document_format beyond the schema, which already covers them well.

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: 'Get an upload destination for a file your shell transfers directly,' and immediately frames the purpose as keeping content out of the context window. It is clearly distinguishable from the attaching siblings (create_project, update_project) that consume the returned reference.

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 an explicit three-step workflow (call tool, run upload_command, pass reference), names the consumer tools and the exact field path (documents[].s3_url), adds repo_slug for multi-repo external_findings, and states a when-not case: do not upload source code, use create_project's github_repo instead.

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.