Skip to main content
Glama

CipherHUB Cryptography Toolkit

ml_kem_keygen

Read-only

[pqc_kem] 生成 ML-KEM 密钥对(FIPS 203,后量子密钥封装标准)。 【算法选择】ML-KEM-512(NIST Level 1)/ ML-KEM-768(Level 3,推荐)/ ML-KEM-1024(Level 5)。 【参数】

  • algorithm:算法名

  • seed_in_hex:可选,64 字节种子 hex(128 字符)。填入时按该种子确定性生成

  • use_random_seed:可选。true 强制随机并忽略 seed_in_hex;false 必须提供 seed_in_hex;不传时按 seed_in_hex 是否为空决定:空则随机,非空则确定性 【输出】public_key_in_hex、public_key_in_base64、secret_key_in_hex、secret_key_in_base64、seed_in_hex、algorithm、nist_level、public_key_bytes、secret_key_bytes。 【后续操作】公钥用于 ml_kem_encap,私钥用于 ml_kem_decap。

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

Input Schema

NameRequiredDescriptionDefault
algorithmNo密码算法名称(具体可选值因工具而异,见工具描述)ML-KEM-768
seed_in_hexNoML-KEM 密钥生成种子的十六进制字符串,可选。留空时由服务端随机生成;填写时必须为 128 个 hex 字符(64 字节)
use_random_seedNo可选。true 强制随机并忽略 seed_in_hex;false 必须提供 seed_in_hex;不传时按 seed_in_hex 是否为空决定:空则随机,非空则确定性

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / seed_in_hex / description
      Previous value: -"ML-KEM 密钥生成种子的十六进制字符串,固定 128 个 hex 字符(64 字节)"New value: +"ML-KEM 密钥生成种子的十六进制字符串,可选。留空时由服务端随机生成;填写时必须为 128 个 hex 字符(64 字节)"
    • addedInput schema / properties / seed_in_hex / maxLength
      Added value: +128
    • addedInput schema / properties / seed_in_hex / pattern
      Added value: +"^([0-9a-fA-F]{2})*$"
    • changedInput schema / properties / use_random_seed / description
      Previous value: -"True 时忽略 seed_in_hex,使用 CSPRNG 随机生成种子"New value: +"可选。true 强制随机并忽略 seed_in_hex;false 必须提供 seed_in_hex;不传时按 seed_in_hex 是否为空决定:空则随机,非空则确定性"
  2. Changed4 schema fields changed
    • changedInput schema / properties / seed_in_hex / default
      Previous value: -"30313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233"New value: +""
    • addedInput schema / properties / use_random_seed / anyOf
      Added value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / use_random_seed / default
      Previous value: -falseNew value: +null
    • removedInput schema / properties / use_random_seed / type
      Removed value: -"boolean"
  3. Changed4 schema fields changed
    • addedInput schema / properties / algorithm / description
      Added value: +"密码算法名称(具体可选值因工具而异,见工具描述)"
    • addedInput schema / properties / algorithm / enum
      Added value: +[
      +  "ML-KEM-512",
      +  "ML-KEM-768",
      +  "ML-KEM-1024"
      +]
    • addedInput schema / properties / seed_in_hex / description
      Added value: +"ML-KEM 密钥生成种子的十六进制字符串,固定 128 个 hex 字符(64 字节)"
    • addedInput schema / properties / use_random_seed / description
      Added value: +"True 时忽略 seed_in_hex,使用 CSPRNG 随机生成种子"
  4. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the description's job is to explain the determinism model — and it does: seed_in_hex produces deterministic output, use_random_seed=true forces randomness and ignores the seed, false requires a seed, and omitting it falls back to seed-emptiness. It also enumerates the returned fields and NIST levels, which matters since no output schema exists. It stops short of saying whether generated keys are persisted server-side or of any secret-key handling caveat, which is the remaining gap for a key-generation tool.

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 sectioned layout (algorithm choice, parameters, output, next steps) is front-loaded and scannable, with zero filler sentences. The only inefficiency is the parameter block duplicating schema text that is already fully documented.

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 three-parameter key-generation tool with no output schema, the definition covers algorithm tiers, determinism semantics, the full return-field list, and downstream tool wiring — enough for an agent to call it correctly on the first attempt. The omission of persistence/secret-handling context is minor but real for a cryptographic key tool.

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%, and the schema already documents the algorithm enum, the 128-hex-char seed constraint, and the use_random_seed precedence rules in essentially the same words used in the description. The 【参数】 block therefore restates rather than extends the schema, so the baseline 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 opens with a specific verb and resource — generate an ML-KEM key pair — and anchors it to FIPS 203 with an explicit post-quantum KEM label, which separates it cleanly from the ML-DSA signature siblings and from generic generators like generate_random_data. The bracketed [pqc_kem] tag and the algorithm-family naming make the tool's identity unambiguous before any schema is opened.

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 states the selection guidance explicitly: ML-KEM-768 is marked as recommended (Level 3) versus 512/1024, and the 【后续操作】 block routes the agent forward — public key to ml_kem_encap, secret key to ml_kem_decap. What is missing is any negative guidance (e.g., when to use ml_dsa_keygen instead, or that this tool does not persist keys), but the positive routing is stronger than most definitions.

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.