Skip to main content
Glama

导出JSON到文件

export_to_file

Export JSON data to a specified file in JSON, JSONL, or CSV format. Supports absolute or relative paths, automatic directory creation, and precise insertion at defined line numbers.

Instructions

将JSON数据导出到指定文件,支持多种格式和插入位置。支持绝对路径和相对路径,自动创建不存在的目录。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes目标文件路径:支持绝对路径(如'D:/data/export.json')或相对路径(如'./output/export.json')。相对路径相对于当前工作目录
formatNo输出格式:json(标准JSON格式)、jsonl(每行一个JSON)、csv(逗号分隔值,仅支持扁平结构)json
insert_lineNo插入行号:从1开始,指定在文件的第几行插入内容。不指定则覆盖整个文件
json_idsYesJSON ID列表:要导出的JSON的ID数组。使用item_operations工具查看可用的JSON ID
pretty_printNo是否美化输出:true(格式化缩进)、false(紧凑格式)
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It discloses some behavioral traits like automatic directory creation and support for absolute/relative paths, but it doesn't cover critical aspects such as whether this is a destructive operation (e.g., file overwriting), error handling, permissions needed, or rate limits. For a write operation with zero annotation coverage, this is a significant gap.

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?

The description is appropriately sized with two sentences that are front-loaded and efficient. Every sentence adds value: the first states the core purpose and key features, and the second provides practical details on path handling and directory creation, with zero waste.

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

Completeness2/5

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

Given the complexity (a write operation with 5 parameters, no annotations, and no output schema), the description is incomplete. It lacks information on behavioral aspects like destructiveness, error handling, and output format details. Without annotations or an output schema, the description should do more to compensate, but it falls short, leaving gaps for a tool that modifies files.

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 the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by mentioning '支持多种格式和插入位置' (supports multiple formats and insertion positions), which loosely relates to 'format' and 'insert_line' parameters, but doesn't provide additional syntax or meaning. Baseline 3 is appropriate when the schema does the heavy lifting.

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 description clearly states the verb ('导出' meaning export) and resource ('JSON数据' meaning JSON data) to a file, specifying the action and target. It distinguishes from siblings by focusing on file export rather than JSON generation (batch_generate_json) or item operations (item_operations). However, it doesn't explicitly mention that it's for writing/creating files, which could be slightly more specific.

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?

The description implies usage by mentioning support for multiple formats and insertion positions, and it references item_operations for viewing JSON IDs, providing some context. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., batch_generate_json for creating JSON vs. exporting existing JSON), and no exclusions or prerequisites are stated.

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

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zb2947244682/mcp-json-maker'

If you have feedback or need assistance with the MCP directory API, please join our Discord server