Skip to main content
Glama

CipherHUB Cryptography Toolkit

sm2_private_key_structure_parse

Read-only

[sm2] 解析 SM2 加密私钥(ENCRYPTED PRIVATE KEY PEM)结构,返回 ASN.1 内部字段的 JSON 视图。用于调试与教学,不会解出私钥值。返回字段:structure(ASN.1 结构 JSON,含加密算法 OID、盐、迭代次数等)。

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

Input Schema

NameRequiredDescriptionDefault
private_key_in_pemNoSM2 加密私钥的 PEM 文本(含 BEGIN/END ENCRYPTED PRIVATE KEY 头尾)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / private_key_in_pem / description
      Added value: +"SM2 加密私钥的 PEM 文本(含 BEGIN/END ENCRYPTED PRIVATE KEY 头尾)"
  2. First observed

TDQS

A3.9/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds genuinely new behavioral context: the parse is inspection-only and deliberately does not recover the private key value, which sets expectations about what output can and cannot contain.

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?

One compact sentence states the target format, the operation, and the non-decryption guarantee up front, followed by a short return-field note. There is no filler, though the bracketed '[sm2]' prefix and mixed-language phrasing make it slightly less scannable.

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 one-parameter, read-only parsing tool with no output schema, the description covers input format, read-only behavior, and the key return field (structure with OID, salt, iteration count). An agent has enough to invoke it correctly; only the exact JSON shape of 'structure' remains implicit.

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?

The single parameter has full schema coverage, including a description naming the PEM with BEGIN/END ENCRYPTED PRIVATE KEY headers, so the schema does the heavy lifting. The description's mention of algorithm OID, salt, and iteration count refers to return fields rather than adding parameter-level meaning, leaving this at baseline.

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 states a specific verb and resource: parsing the ASN.1 structure of an SM2 ENCRYPTED PRIVATE KEY PEM and returning a JSON view. The clause '不会解出私钥值' explicitly distinguishes it from decryption siblings such as sm2_decryption, though it does not name the generic asn1_parse as a related alternative.

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?

It gives a clear use context ('用于调试与教学') and a scope limit ('不会解出私钥值'), which steers the agent toward this tool for inspection only. It does not name specific alternatives for when a different tool would be preferable, so it falls short of explicit when-not routing.

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.