Skip to main content
Glama

CipherHUB Cryptography Toolkit

cbor_decode

Read-only

[structured_message] 把 CBOR 字节流解码为 JSON,并给出逐字段结构拆解树(RFC 8949)。 【算法】CBOR 解码,定长(§3.2.1)与不定长(§3.2.2)均容忍; 要求单数据项且逐字节闭合(尾随字节即拒绝)。 【参数】

  • cbor_in_hex:CBOR 字节的十六进制字符串(1B~128KB) 【输出】decoded_json(bytes→{"hex":…}、tag→{"tag","value"}、 语义 tag→date_time/uuid 等标注形式)、decoded_type、decoded_length、 structure_tree(offset/header_len/total_len/major_type/length_form/rfc_note)、truncated、warnings。 【注意】structure_tree 超过 20000 节点或深度超 64 会截断并置 truncated=true;cbor2 对 tag 0/1/2/3 等有内置语义解码,wire 层形态以 structure_tree 为准。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "cbor_decode"
  }
}

Input Schema

NameRequiredDescriptionDefault
cbor_in_hexNoCBOR 字节的十六进制字符串(1B~128KB,单数据项且逐字节闭合)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior5/5

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

Annotations only cover readOnlyHint=true and openWorldHint=false, and the description goes well beyond them. It discloses strict rejection of trailing bytes, truncation limits of 20000 nodes or depth 64, with truncated=true set, and that cbor2 applies built-in semantic decoding to tags 0/1/2/3, while structure_tree remains the authoritative wire-layer view. These are concrete behavioral facts that an agent cannot get from annotations or 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?

The purpose is front-loaded, and the labeled sections 【算法】/【参数】/【输出】/【注意】 make the block easy to scan. It is somewhat long, and the 【输出】 section enumerates return fields at a level of detail that is only marginally useful to an agent selecting a tool, but no sentence is empty filler.

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

Completeness5/5

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

There is no output schema, so the description carries the full burden of describing the return values. It does so in detail: decoded_json shape, decoded_type, decoded_length, structure_tree fields, truncated, and warnings. Together with the validation rules and truncation limits, this tells an agent everything it needs in order to call the tool correctly and to interpret the result.

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 coverage is 100%, and the schema already documents the hex string, its 1B~128KB range, and the single-closed-item constraint. The 【参数】 block largely repeats that text. It therefore adds little meaning beyond the schema, so the high-coverage baseline of 3 applies.

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: it decodes a CBOR byte stream into JSON and produces a per-field structure tree, citing RFC 8949. That 'decode' framing is the opposite of the sibling tool cbor_encode, so an agent can select between them without opening either schema.

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 gives strong rules about which inputs are valid: a single data item, byte-exact closure, and trailing bytes are rejected, and it states that both definite-length (§3.2.1) and indefinite-length (§3.2.2) items are tolerated. It never states when to use this tool rather than an alternative, and it never names a sibling. Usage is therefore only implied.

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.