Skip to main content
Glama
atengk
by atengk

sftp_write_file

Write or overwrite a text file on a remote SSH host, optionally creating missing parent directories recursively. Use it to update remote files via SFTP from an MCP agent.

Instructions

写入并覆盖远程主机文本文件(支持自动递归创建父级目录)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes待写入的文本内容
remotePathYes远程文件绝对路径
connectionIdNo目标连接标识符,缺省时使用当前默认连接
createDirectoriesNo当远程父级目录不存在时是否自动递归创建,默认 true

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.5

TDQS

B3.2/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It does disclose two meaningful traits beyond the schema: the write overwrites existing content, and parent directories are auto-created recursively. But it omits encoding, error behavior on failure, permission requirements, and whether the overwrite is atomic or truncating.

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?

A single tight sentence with the core action front-loaded and secondary behavior in parentheses. No filler, though it is on the sparse side for a mutation tool.

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 a 4-parameter write tool with no annotations and no output schema, the description covers the essential overwrite-and-create behavior but leaves unanswered what happens on failure, how existing file contents are affected mid-write, and whether special handling applies to non-text content.

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 all four parameters are already documented, setting the baseline at 3. The description reinforces the createDirectories default behavior but adds no syntax, path-format, or content-type details beyond what the schema states.

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?

States a specific verb and resource ('写入并覆盖远程主机文本文件') and adds the qualifier 'text file', which implicitly separates it from the binary-oriented sftp_upload sibling. However, it never names or contrasts with any sibling explicitly, so differentiation is left to inference.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance. The phrase '文本文件' hints that binary transfers belong to sftp_upload, but the agent is not told this, nor are prerequisites (connection setup, permissions) or the relationship to sftp_mkdir described.

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