Skip to main content
Glama
Magic Lane MCP DevKit Server

Magic Lane MCP DevKit Server

Official
by magiclane

Create API Key

create_api_key
Destructive

Generates an API key for a Magic Lane project so apps can authenticate with the SDK and APIs, with optional expiry and file output to share the key without revealing it.

Instructions

Create an API key for a project (the key apps use with the Magic Lane SDK and APIs; not the secret key this server runs with). Name 6–64 characters, unique in the project; optional expiry as an ISO date, default 6 months. The key is masked unless revealToken is true; set that only when the user asks to see the key. To hand the key to the user without showing it here, give tokenPath and it is written to that file (a new file; an existing one is replaced only with overwrite: true). A tokenPath that is refused stops the call before the key is created. The key can be read again later with get_api_key. A project can have at most 2 API keys: with that many there the create fails (check with list_api_keys first), and a place is freed only in the developer portal. Not idempotent. Requires "API keys: Read & write".

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectId": "<projectId>",
      "name": "<name>"
    },
    "name": "create_api_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesAPI key name, 6–64 characters, no line breaks or tabs; unique in the project.
expiresAtNoWhen the key expires, as an ISO 8601 date or date-time (a date alone means 00:00 UTC, and a date-time without an offset is taken as UTC). In the future and at most 10 years ahead. Default: 6 months from now (as in the portal).
overwriteNoReplace the file at tokenPath if it exists. Default false: an existing file is refused. Set it only when the user wants that file replaced.
projectIdYesProject id (UUID), from list_projects or create_project.
tokenPathNoWrite the full API key to this file (absolute, or relative to the folder MAGICLANE_FILES_DIR names when the server has one, otherwise the server's working directory), created readable only by the user where the system supports it. An existing file is replaced only with overwrite: true, and a network path is refused. A path that starts with ~/ or ~user/ is refused: ~ is not read as a home folder. The key itself is not put in the result.
revealTokenNoReturn the full API key in the result. Default false: the key is masked (only its last 4 characters). Set true only when the user asks to see the key; prefer tokenPath when it is available.

Output Schema

NameRequiredDescriptionDefault
keyYesThe API key, masked unless the full key was asked for.
notesYesThings to know about this result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the destructiveHint/idempotentHint annotations: it discloses the 2-keys-per-project ceiling and resulting failure, that a refused tokenPath aborts before creation (no partial write), that an existing file is only replaced with overwrite, and the required "API keys: Read & write" permission. It also restates non-idempotency in context, reinforcing rather than contradicting the annotations.

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?

Front-loads the purpose and the disambiguation, then orders constraints, side effects, and prerequisites sensibly. It is dense but repeats several facts already in the schema (name length, default expiry), so a little trimming is possible.

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?

An output schema exists, so return-value detail is unnecessary; the description instead covers the things the schema cannot: quota limits, permission requirements, ordering of side effects on failure, and how to retrieve the key later. Nothing an agent needs to call this safely is missing.

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

Parameters4/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, but the description adds decision-level meaning: uniqueness and length constraints on name, the 6-month default expiry, and the rule that overwrite is only for intentional replacement. Most of the tokenPath detail duplicates the schema, which keeps it from a 5.

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?

States a specific verb and resource ("Create an API key for a project") and immediately disambiguates the ambiguous term "API key" from the server's own secret key. It also points to the read counterpart (get_api_key), so an agent can distinguish create from retrieve without inspecting schemas.

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

Usage Guidelines5/5

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

Gives explicit conditional guidance: set revealToken "only when the user asks to see the key", prefer tokenPath to hand the key over, check list_api_keys first because a project caps at 2 keys, and note that slots are freed only in the portal. It also names the alternative path (get_api_key) for later retrieval.

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