Skip to main content
Glama

w3_key_create

Generate and export a new ed25519 key pair for secure cryptographic operations. Ideal for managing identities and access in the MCP IPFS network.

Instructions

Generates and prints a new ed25519 key pair. Does not automatically use it for the agent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsonNoExport the new key pair as dag-json (default: false).

Implementation Reference

  • Handler function that validates input using the schema, executes the 'w3 key create' command (with optional --json flag), parses the output if JSON, and returns structured content with the new key pair data or raw output.
    const handleW3KeyCreate: ToolHandler = async (args) => {
      const parsed = Schemas.W3KeyCreateArgsSchema.safeParse(args);
      if (!parsed.success)
        throw new Error(
          `Invalid arguments for w3_key_create: ${parsed.error.message}`
        );
      const { json } = parsed.data;
      const command = json ? "key create --json" : "key create";
      const { stdout } = await runW3Command(command);
      if (json) {
        try {
          const keyData = JSON.parse(stdout);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({
                  message: "New key pair created (JSON format).",
                  keyData,
                }),
              },
            ],
          };
        } catch (e) {
          logger.warn("Failed to parse key create JSON, returning raw.");
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({
                  message: "New key pair created (raw output).",
                  output: stdout.trim(),
                }),
              },
            ],
          };
        }
      } else {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                message: "New key pair created (raw output).",
                output: stdout.trim(),
              }),
            },
          ],
        };
      }
    };
  • Zod schema defining the input arguments for the w3_key_create tool, including an optional 'json' boolean flag.
    export const W3KeyCreateArgsSchema = z
      .object({
        json: z
          .boolean()
          .optional()
          .default(false)
          .describe("Export the new key pair as dag-json (default: false)."),
      })
      .describe(
        "Generates and prints a new ed25519 key pair. Does not automatically use it for the agent."
      );
  • The exported toolHandlers object registers 'w3_key_create' to the handleW3KeyCreate function.
    export const toolHandlers: Record<string, ToolHandler> = {
      w3_login: handleW3Login,
      w3_space_ls: handleW3SpaceLs,
      w3_space_use: handleW3SpaceUse,
      w3_space_create: handleW3SpaceCreate,
      w3_up: handleW3Up,
      w3_ls: handleW3Ls,
      w3_rm: handleW3Rm,
      w3_open: handleW3Open,
      w3_space_info: handleW3SpaceInfo,
      w3_space_add: handleW3SpaceAdd,
      w3_delegation_create: handleW3DelegationCreate,
      w3_delegation_ls: handleW3DelegationLs,
      w3_delegation_revoke: handleW3DelegationRevoke,
      w3_proof_add: handleW3ProofAdd,
      w3_proof_ls: handleW3ProofLs,
      w3_key_create: handleW3KeyCreate,
      w3_bridge_generate_tokens: handleW3BridgeGenerateTokens,
      w3_can_blob_add: handleW3CanBlobAdd,
      w3_can_blob_ls: handleW3CanBlobLs,
      w3_can_blob_rm: handleW3CanBlobRm,
      w3_can_index_add: handleW3CanIndexAdd,
      w3_can_upload_add: handleW3CanUploadAdd,
      w3_can_upload_ls: handleW3CanUploadLs,
      w3_can_upload_rm: handleW3CanUploadRm,
      w3_plan_get: handleW3PlanGet,
      w3_account_ls: handleW3AccountLs,
      w3_space_provision: handleW3SpaceProvision,
      w3_coupon_create: handleW3CouponCreate,
      w3_usage_report: handleW3UsageReport,
      w3_can_access_claim: handleW3CanAccessClaim,
      w3_can_store_add: handleW3CanStoreAdd,
      w3_can_store_ls: handleW3CanStoreLs,
      w3_can_store_rm: handleW3CanStoreRm,
      w3_can_filecoin_info: handleW3CanFilecoinInfo,
      w3_reset: handleW3Reset,
    };
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it generates a key pair, prints it (implying output to the user), and clarifies that it doesn't auto-apply the key. This covers key aspects like mutation (creation) and output format, though it could add details on security implications or error handling.

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 extremely concise—two short sentences that directly state the tool's function and a key behavioral note. Every word serves a purpose, with no redundancy or fluff, making it easy to parse and front-loaded with essential information.

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?

Given the tool's low complexity (one optional parameter, no output schema, no annotations), the description is mostly complete. It explains what the tool does and a critical behavioral trait (no auto-use). However, it could be slightly more complete by mentioning the output format (e.g., printed as text or JSON) or any side effects, though this is minor.

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%, with the single parameter 'json' fully documented in the schema as controlling export format. The description does not add any parameter-specific information beyond what the schema provides, so it meets the baseline score of 3 for high schema coverage without extra value.

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 clearly states the specific action ('Generates and prints') and resource ('a new ed25519 key pair'), making the purpose immediately understandable. It distinguishes itself from sibling tools by focusing on key generation rather than account management, storage operations, or other functions listed in the sibling tools.

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 description implies usage by stating 'Does not automatically use it for the agent,' which suggests this tool is for creating keys that must be manually applied elsewhere. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., if other tools handle key management) or any prerequisites, leaving some ambiguity.

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

Install Server

Other Tools

Related Tools

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/alexbakers/mcp-ipfs'

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