Skip to main content
Glama

CipherHUB Cryptography Toolkit

generate_sm2

[sm2] 生成 SM2(SM2P256V1 / 国密曲线)密钥对。 【参数】

  • private_key_password:必填,私钥 PEM 加密口令(1-64 字节;私钥只有加密 PEM 一种导出形态) 【输出】public_key_in_pem、private_key_in_pem、z_in_hex、point_x_in_hex、point_y_in_hex、public_key_in_hex、private_key_in_hex。 【后续操作】公钥用于 sm2_encryption / sm2_verify,私钥用于 sm2_decryption / sm2_sign。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
private_key_passwordNo私钥的加密密码(原始字符串,非编码格式),可选

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / private_key_password / description
      Added value: +"私钥的加密密码(原始字符串,非编码格式),可选"
  2. First observed

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations provided, the description carries the disclosure burden. It usefully states that the private key is exported only as an encrypted PEM and lists the output fields. However, it does not mention side effects, prerequisites, or operational constraints, and the claim that private_key_password is required contradicts the schema where it is optional.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact, front-loaded with the core purpose, and organized with clear 【参数】, 【输出】, and 【后续操作】 sections. Every section earns its place and no filler is present.

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

Completeness3/5

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

Because there is no output schema, the explicit list of output fields is valuable. The one-parameter tool is otherwise simple, but the required/optional contradiction about private_key_password leaves an agent uncertain whether the parameter can be omitted, which is a meaningful gap in completeness.

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%, so the baseline is 3. The description adds meaningful constraints (password must be 1-64 bytes; private key is only exported as encrypted PEM), but it also states '必填' while the schema marks the parameter optional with a default of '', creating an inconsistency that hurts reliability.

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 opens with a specific verb-resource pair: '生成 SM2(SM2P256V1 / 国密曲线)密钥对'. This clearly identifies the tool as SM2 key-pair generation and distinguishes it from siblings such as generate_rsa, generate_sm9, and generate_ecc without needing to inspect schemas.

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 description gives clear downstream context: the public key should be used for sm2_encryption / sm2_verify and the private key for sm2_decryption / sm2_sign. It does not explicitly name alternatives or exclusion conditions, but the SM2-specific workflow is clear enough for an agent to infer when to select this tool.

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.