Skip to main content
Glama

upload_file_stream

Streams file chunks to the bot's local storage and returns a sendable local file path. Supports resumable stream state, chunk verification, and SHA256 checks.

Instructions

以流式分块方式上传文件到机器人本地(返回可用于发送的本地路径) 第 1 步:每次上传生成新的 stream_id;这里上传 hello 的唯一分块。通过 invoke_action 调用,分块确认不等于整文件完成。 Returns: 流式帧:分块确认 type=stream、完成 type=response(含 file_path/file_name/file_size/sha256)

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": {
      "stream_id": "<stream_id>"
    },
    "name": "upload_file_stream"
  }
}

Input Schema

NameRequiredDescriptionDefault
resetNo重置并丢弃该流
filenameNo文件名
file_sizeNo文件总大小(字节)
stream_idYes流 ID(客户端生成的 UUID,限 [A-Za-z0-9_-])
chunk_dataNo分块数据(Base64)
chunk_indexNo分块索引(从 0 开始)
is_completeNo是否为最后一个分块/触发合并
verify_onlyNo仅查询当前流状态
total_chunksNo总分块数(新流必填)
file_retentionNo合并文件保留毫秒(0=不回收)
expected_sha256No期望的整文件 SHA256(校验)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior4/5

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

Annotations only declare the write/open-world/non-destructive profile, and the description adds real lifecycle information beyond that: per-upload stream_id generation, the distinction between chunk-ack and full completion, and the two frame types returned (type=stream acknowledgement, type=response with file_path/file_name/file_size/sha256). It omits how file_retention expiry and reset discard behave, which matter given the 300000ms default.

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

Conciseness3/5

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

The purpose and Returns lines are front-loaded and earn their place, but the middle '第 1 步 … 上传 hello 的唯一分块' sentence reads as leftover example text that does not generalize and risks being taken as an instruction about a specific payload. Structure is fine; that fragment is the weak point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter stateful streaming protocol with no output schema, the description covers the frame contract but leaves important behavior unexplained: file_retention defaults to 300000ms (files expire), reset discards a stream, verify_only is a read-only status probe on an otherwise write tool, and expected_sha256 triggers verification. An agent could call it but not reason about retention or abort paths.

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%, so every parameter is already documented, and the description adds no syntax, defaults, or constraints beyond that. The baseline of 3 applies; the description does not explain sequencing (total_chunks on a new stream, expected_sha256 verification) even though it alludes to stream progress.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence states a specific verb and resource — streaming chunked upload of a file to bot-local storage — and names the payoff (a local path usable for sending), which distinguishes it from the download_*_stream siblings. The stray '上传 hello 的唯一分块' example fragment muddies rather than clarifies, and no sibling is named as an alternative.

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

Usage Guidelines3/5

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

It does give procedural context: it must be invoked via invoke_action, a new stream_id must be generated per upload, and a chunk acknowledgement does not mean the whole file is done. However, it never states when to pick this over upload_private_file / upload_group_file or when streaming is preferable to a one-shot upload.

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

Deploy Server

Other Tools