Skip to main content
Glama

user_create_api_key

Generate a new API key for Crafty Controller users to authenticate and access server functionality programmatically.

Instructions

Generate a new API key for a Crafty Controller user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesUser ID or '@me'
nameNoOptional name/description for the API key

Implementation Reference

  • The registration and handler implementation for the 'user_create_api_key' tool. It uses zod for input validation and calls the client to create an API key.
    server.tool(
      "user_create_api_key",
      "Generate a new API key for a Crafty Controller user",
      {
        user_id: z.string().describe("User ID or '@me'"),
        name: z.string().optional().describe("Optional name/description for the API key"),
      },
      async ({ user_id, name }) => {
        try {
          const data = await client.post(`/users/${user_id}/api`, name ? { name } : undefined);
          return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
        } catch (error) {
          const msg = error instanceof Error ? error.message : String(error);
          return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
        }
      }
Behavior2/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. While it indicates this is a creation/mutation operation ('Generate a new API key'), it doesn't disclose important behavioral aspects like whether this requires admin permissions, what format the generated key has, whether there are rate limits, or if the operation is idempotent. The description is minimal and lacks necessary context for safe use.

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 a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for the tool's complexity and front-loads the core functionality without unnecessary elaboration.

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

Completeness2/5

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

For a mutation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what the tool returns (e.g., the generated API key value), error conditions, authentication requirements, or permission constraints. Given the security implications of API key generation, more contextual information is needed for safe and effective use.

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?

The schema description coverage is 100%, so both parameters are documented in the schema itself. The description doesn't add any additional semantic information about the parameters beyond what's in the schema. It doesn't explain the significance of '@me' for user_id or provide examples of appropriate name values. This meets the baseline for good schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Generate a new API key') and the target resource ('for a Crafty Controller user'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'user_get_api_keys' or 'user_delete_api_key', but the verb 'Generate' distinguishes it from those read/delete operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'user_get_api_keys' or 'user_delete_api_key', nor does it mention prerequisites such as authentication requirements or user permissions needed to generate API keys for other users. It simply states what the tool does without contextual usage information.

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

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/HadiCherkaoui/crafty-mcp'

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