Skip to main content
Glama

CipherHUB Cryptography Toolkit

der_encode

Read-only

[structured_message] 把 JSON 节点 DSL 编码为 DER 字节(X.690)。 【算法】DER 规范编码(定长最短 + SET OF 排序);或教学 BER 不定长 (构造容器 0x80 + EOC,复刻 AWS KMS 回包形态)。 【参数】

  • json_payload:节点 DSL(≤65536 字符),一节点一主键: {"integer": n}/{"enumerated": n}/{"boolean": true}/{"null": true}; {"oid": "1.2.840…"}(首弧 0/1 时次弧≤39); {"octet_string": ""}/{"bit_string": {"hex","unused_bits":0..7}}; {"utf8_string"|"printable_string"|"ia5_string"|"numeric_string": s}; {"utc_time": "YYMMDDHHMMSSZ"}/{"generalized_time": "YYYYMMDDHHMMSS[.f]Z"}; {"sequence": [节点]}/{"set": [节点]}; {"context"|"application"|"private": {"number": n, "children": [节点]|"primitive_hex": ""}}(children=[单节点] 即 EXPLICIT、[内层孩子们] 即 IMPLICIT-constructed); {"raw": {"tag_hex", "content_hex"}}(逃生舱)

  • der:True=规范 DER(SET OF 按 X.690 §11.6 完整子 TLV 字节排序)

  • ber_indefinite:True=构造容器不定长 BER(原语保持定长,§8.1.3.4) 【输出】encoded_in_hex、encoded_length、der、der_conformant、ber_features、 structure_tree(编码输出回剖的免费拆解树)、truncated、warnings。 【注意】der 与 ber_indefinite 互斥;两者皆 false 为定长 + SET OF 作者序的 教学 BER 态;时间只收线上原格式(不做 ISO 便捷转换)。

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": "der_encode"
  }
}

Input Schema

NameRequiredDescriptionDefault
derNoTrue=规范 DER(X.690 §10 定长最短 + SET OF 按 §11.6 排序);与 ber_indefinite 互斥
json_payloadNo待编码的结构化消息 JSON 文本(≤65536 字符)。CBOR:{"$bytes":"<hex>"} 渲染 byte string、{"$tag":n,"value":…} 渲染 tagged value;DER:ASN.1 节点 DSL(一节点一主键,如 {"sequence":[{"oid":"1.2…"}]},形态清单见 der_encode 工具描述)
ber_indefiniteNoTrue=构造容器不定长 BER(0x80 + 两字节 EOC 递归,原语保持定长;AWS KMS 回包同款形态)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare a pure read-only, closed-world operation, and the description adds substantive context beyond that: a 65536-character payload ceiling, the mutual exclusion of der and ber_indefinite, strict acceptance of only wire-format time strings (no ISO convenience conversion), and an enumerated result surface (encoded_in_hex, der_conformant, ber_features, structure_tree, truncated, warnings). It stops short of describing failure/error behavior, so it does not reach the top of the scale.

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?

Purpose and algorithm are correctly front-loaded, but the 【参数】block reproduces the node-form grammar almost verbatim from the input schema's own description, which is duplicated effort. The bracketed section labels aid scanning, yet the definition carries noticeable redundancy for its length.

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?

For a grammar-heavy encoder with no output schema, the definition covers the accepted node forms, the mode interactions, the payload limit, and the return fields, which is close to what an agent needs. It lacks a worked example payload and any statement of error/validation responses, which are the remaining gaps.

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, but the description adds semantics the schema does not: the first-arc/second-arc constraint for OIDs (first arc 0/1 implies second arc ≤39), and the crucial rule that children=[single node] means EXPLICIT while children=[inner children] means IMPLICIT-constructed. Those distinctions directly affect how a caller builds json_payload.

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 opening line names a specific verb and resource: encoding a JSON node DSL into DER bytes under X.690. The explicit naming of DER/ASN.1 plus the BER teaching variant makes it unambiguous versus a CBOR or parse-oriented sibling, so an agent can identify the tool 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 Guidelines4/5

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

The 【参数】and 【注意】sections spell out the three operating modes (der=True canonical DER, ber_indefinite=True indefinite-length BER, both false = teaching BER with author-order SET OF) and state that der and ber_indefinite are mutually exclusive. That is real mode-selection guidance, but there is no guidance on when to choose this tool over a decode/parse sibling or what to do on rejection.

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.