Skip to main content
Glama

import_key

Import externally generated keys into AWS Payment Cryptography using TR-31 key blocks or TR-34. Submit key material, KCV algorithm, and enablement flags, then verify Multi-Party Approval status before using the key.

Instructions

Call this to bring an externally generated key into APC via TR-31 key block or TR-34. The key_material dict structure depends on the import method.

IMPORTANT — this call does not always mean the key is imported. If the account has Multi-Party Approval associated with the import operation (see get_mpa_team_association), the response carries an MpaStatus with Status PENDING and the key is NOT yet usable. Approval by the MPA team has to land first. Treat a successful response as "submitted", not "done": check MpaStatus before using the key or reporting the import as complete, and poll get_key until the status clears. A response with no MpaStatus is an ordinary immediate import.

For TR-31 (wrapping an existing key): key_material = { "Tr31KeyBlock": { "WrappingKeyIdentifier": "", "WrappedKeyBlock": "" } }

For TR-34 (distributing a symmetric key using asymmetric techniques): key_material = { "Tr34KeyBlock": { "CertificateAuthorityPublicKeyIdentifier": "", "ImportToken": "", "KeyBlockFormat": "X9_TR34_2012", "WrappingKeyCertificate": "", "SigningKeyCertificate": "", "EncryptedKeyBlock": "" } }

Args: key_material: Import method and wrapped key material key_check_value_algorithm: CMAC, ANSI_X9_24, HMAC, or SHA_1. AES keys must use CMAC (ANSI_X9_24 is rejected here per PCI PIN Annex C); TDES may use either. HMAC keys use HMAC — the construction is fixed but the hash is the one bound to the key at creation, over a zero-length message, so reproducing the KCV outside APC requires knowing that hash. Asymmetric keys use SHA_1. enabled: Activate key immediately after import tags: Optional list of {Key, Value} tag dicts replication_regions: Optional list of regions to replicate the imported key into. Omit to use the account default (see get_default_key_replication_regions). requester_comment: Optional reason for the import, max 200 characters. Shown to Multi-Party Approval reviewers when the import is gated. Appears in CloudTrail in plaintext — no personal or sensitive data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNo
enabledNo
key_materialYes
requester_commentNo
replication_regionsNo
key_check_value_algorithmNo

Schema Changelog

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

  1. First observedv1.2.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden, and it delivers. It explicitly warns that a successful response may not mean the key is imported, explains the MpaStatus PENDING scenario, tells the agent to check MpaStatus before using the key, and directs polling get_key. It also discloses that requester_comment appears in CloudTrail in plaintext. These are exactly the non-obvious behaviors an agent needs.

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 long, but every section earns its place. The critical MPA warning is front-loaded immediately after the purpose, followed by compact parameter semantics and concrete JSON examples. The structure is scannable and avoids filler.

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?

Given the complexity, no annotations, and no output schema, the description is notably complete: it covers the external-key import purpose, both formats, prerequisites, MPA status behavior, validation constraints, optional parameters, and even a privacy caution. An agent has enough context to invoke the tool correctly and interpret the outcome.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does thoroughly. It gives full key_material dict shapes for both TR-31 and TR-34, enumerates valid key_check_value_algorithm values with AES/CMAC constraints and the HMAC caveat, explains enabled, tags, replication_regions, and requester_comment, including the 200-character limit. Every parameter gains meaning beyond the raw 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?

The description opens with a specific verb and resource: 'bring an externally generated key into APC via TR-31 key block or TR-34.' This clearly distinguishes import_key from sibling tools like create_key, which would generate a key internally rather than importing external material.

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 context: it is for externally generated keys, specifies the two supported import methods, and references get_parameters_for_import as a prerequisite for TR-34. It also explains the Multi-Party Approval flow and when to poll get_key. It does not explicitly contrast with create_key or state 'use create_key instead for internally generated keys,' so it stops short of a full when/when-not comparison.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/J8k3/aws-payment-cryptography-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server