Skip to main content
Glama

Create API Key

create_api_key

Create a new API key in one of your workspaces. Requires admin access in that workspace. The plaintext key is shown exactly once in the response. It is never retrievable again after this call, so save it immediately.

Not available when this MCP connection is itself authenticated with an API key (headless mode): a leaked agent key must not be able to mint more keys. Mint keys from an interactive (OAuth) session or the console instead.

workspace: optional workspace id, workspace name, or org-name/workspace-name when the same name occurs in two of your orgs (defaults to your default; use list_workspaces to discover them). name: a label for the key, shown in the workspace's key list later. scopes: key capabilities: ["ingest"] (default) to send telemetry, add "read" (["ingest", "read"] or ["read"]) for a key that can also be used as the Authorization bearer for headless MCP connections. The alert-management capabilities (alerts:manage, channels:manage) are deliberately NOT mintable here — an admin issues those in the console, because a key minted by an agent never expires by default and would be an unbounded credential to leak.

Example:

Create an API key so this agent can send traces.

{ "name": "create_api_key", "arguments": { "name": "my-agent" } }

Give it a key that can also read traces over MCP.

{ "name": "create_api_key", "arguments": { "scopes": ["ingest", "read"] } }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoglassflow-connect-agent
scopesNo
workspaceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare the write, non-idempotent profile, and the description adds material context beyond them: admin access is required, the plaintext key is shown exactly once and never retrievable again, headless-mode minting is blocked to prevent key amplification, and why certain scopes are withheld. These are exactly the operational facts an agent needs before calling.

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-loaded with purpose, then requirement, the one-shot key warning, the availability restriction, parameter docs, and examples. Every sentence carries information, though the two example blocks add length that a shorter inline illustration might have covered. Minor efficiency cost, no real waste.

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 values need not be explained, and the description instead covers the non-obvious return semantics (key shown once). Combined with prerequisites, mode restrictions, and full parameter docs for a 3-param, 0%-coverage schema, nothing needed to call it correctly is missing.

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 carries the full burden and does: workspace documents accepted id/name/'org-name/workspace-name' forms and the default, name states it is a display label, and scopes enumerates the valid values and defaults ('ingest', optionally 'read') plus the exclusions. This fully compensates for the empty 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?

Opens with a specific verb+resource: 'Create a new API key in one of your workspaces.' It also distinguishes itself from the alert-channel/rule creation siblings by stating that alert-management scopes are deliberately not mintable here. An agent can identify the resource, scope, and boundary without opening the schema.

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?

Explicit when-to-use and when-not: unavailable when the MCP connection is authenticated by an API key (headless mode), and the agent is told to mint from an interactive OAuth session or the console instead. It also routes the agent to list_workspaces for workspace discovery. No inference required.

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.

Resources