Skip to main content
Glama

CipherHUB Cryptography Toolkit

cert_parse

[cert] [x509_certificate] 解析 X.509 证书(国际 / 国密 GM SM2 双路径)。输入 PEM 证书(≤10KB),返回:证书类型(X.509 (international) / X.509 (GM SM2),按签名算法 OID 是否落在国密分支 1.2.156.10197 自动判定)、版本、序列号 hex、签名算法及 OID、颁发者/主体 DN(dict 与 RFC4514 串)、有效期(UTC ISO-8601)与当前状态(valid/expired/not_yet_valid,仅信息展示)、是否自签、公钥类型与位数、SAN、扩展清单、SHA-256 与 SM3 双指纹。GM 证书额外返回主体 SM2 公钥:sm2_public_key_hex(裸坐标 X||Y,128 hex 字符)与 sm2_public_key_hex_uncompressed(未压缩点 04||X||Y,130 hex 字符,与 gmssl certparse 的 ECPoint 输出一致)。国际路径 cryptography 实现,SM2 公钥点位走 GmSSL C 库。解析失败(非法 PEM/DER)返回错误码 'Certificate parse failed'。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
certificate_in_pemNo终端实体证书的 PEM 文本(含 BEGIN/END CERTIFICATE 头尾,≤10KB)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Added

TDQS

A4.2/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does it thoroughly: it discloses input size limit, automatic GM OID branch detection, dual fingerprinting, the 'informational only' nature of validity status, library implementation details, and the exact failure error code 'Certificate parse failed.' This goes well beyond minimal safety and operational transparency.

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 description is dense and long, yet each sentence serves a purpose: input constraints, output inventory, GM-specific behavior, implementation notes, and error handling. Some implementation/bibliographic detail could be trimmed, but the structure is front-loaded with the core purpose and remains organized, so the length is justified.

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 must fully disclose what will be returned. It enumerates all major return fields, specifies GM-only additions, gives exact hex formats for SM2 public keys, states validity status behavior, and provides the failure error code. For a complex certificate parser with one input string, this is complete enough for an agent to call and 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 description coverage is 100%, so the baseline of 3 applies. The description repeats the PEM input and size constraint already in the schema but adds no new parameter-level meaning such as accepted encoding variants or handling of empty input. The schema and description are aligned, but the description does not elevate parameter understanding beyond the schema.

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?

Description begins with a specific verb and resource: parse X.509 certificates, and immediately distinguishes the two supported paths (international vs. GM SM2). The detailed list of returned fields makes the tool's scope unmistakable and differentiates it from sibling cert_verify by framing the operation as parsing rather than validation.

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 use case is implied: 'parse X.509 certificate' clearly signals an analysis/parsing task rather than verification. However, the description never explicitly states when to prefer this over cert_verify or any other sibling, and there are no exclusionary conditions. It provides clear context but no formal when/when-not guidance.

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.

TDQS

A3.9/5.0
Disambiguation4/5

Most tools target a distinct algorithm+operation pair (e.g., rsa_sign vs sm2_sign vs ml_dsa_sign), and descriptions are detailed. However, block_cipher and stream_cipher both perform symmetric encryption, and ecc_key_exchange and hybrid_kex overlap as key exchange, requiring careful reading to distinguish.

Naming Consistency3/5

Naming is inconsistent across algorithm families: key generation mixes generate_ecc/generate_rsa with ml_dsa_keygen/ml_kem_keygen, and encryption mixes rsa_encryption/sm2_encryption with block_cipher/stream_cipher. Within each family (e.g., rsa_sign/rsa_verify, ml_dsa_sign/ml_dsa_verify), names are predictable, but the overall pattern is not uniform.

Tool Count2/5

32 tools is far above the typical 3-15 range for a well-scoped server. While every tool has a distinct function, the large surface makes the set heavy and harder to navigate, especially with multiple algorithm families and niche utilities.

Completeness5/5

The toolkit gives comprehensive coverage: key generation, encryption/decryption, signing/verification for RSA, ECC, SM2, ML-DSA, ML-KEM, plus symmetric ciphers, hashing, and key exchange. Full workflows are supported with no dead ends, and even helper tools for debugging are included.