Skip to main content
Glama

ACTION_PARSE_JSON

Parses a JSON string and extracts a value at an optional path, returning formatted JSON and parse success or error details for workflow automation.

Instructions

解析 JSON 字符串并按路径取值。输出:parsed_json, parsed_value, parse_success, parse_error。结果都是字符串(对象/数组为格式化 JSON);路径不存在时结果是字符串 null,但 parse_success 仍为 true。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。

Input Schema

NameRequiredDescriptionDefault
jsonYesJSON 文本(支持 ${var})或存着 JSON 的变量名
pathNo取值路径,如 data.items[0].name;不填返回整个 JSON
requireNo执行后要求为 true 的变量名(如 click_success),不满足按出错处理
on_errorNo节点出错时:skip=跳过继续(默认),stop=停止整个工作流
output_varNo结果变量名(默认 parsed_json)
node_timeout_msNo单节点超时毫秒,0=不限;默认 30 分钟

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full disclosure burden — and it does real work here: it enumerates the four output fields, states that every result is a string, and flags the counterintuitive edge case that a missing path yields the string value null while parse_success stays true. It also discloses ${var} interpolation and that results are returned as a variable snapshot, though it does not explain what happens to pre-existing variables on failure.

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?

Purpose is front-loaded in the first clause, followed by outputs and then edge cases — a sensible order with little waste. Minor blemishes: a duplicated sentence-ending punctuation mark ('。。') and slight redundancy between the null-path note and the general 'results are strings' statement.

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 output schema and no annotations, the description adequately enumerates return fields and covers the important null-path edge case. What is missing is minor but real: whether output_var overwrites existing variables and how require failures surface to the agent.

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; the description goes beyond it by generalizing ${var} interpolation to all string parameters (the schema notes it only for json) and by clarifying the path parameter's failure semantics. It does not elaborate on require or on_error, which the schema already documents.

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 description states a specific verb and resource ('解析 JSON 字符串并按路径取值') and names the exact output fields. The resource (JSON) alone distinguishes it from ACTION_PARSE_XML and ACTION_PARSE_DATETIME, so an agent can select it without opening the schema.

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?

The description explains behavior but never says when to use this tool rather than alternatives (for example, extracting a field from an HTTP response, versus using ACTION_TEXT_OPERATION or ACTION_ARRAY), and it never names a when-not condition. Usage is implied by context, but no explicit guidance is provided.

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