Create API Key
create_api_keyCreate 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" (the default) sends telemetry; "read" also
lets the key be the Authorization bearer for headless MCP connections;
"alerts:manage" creates and configures alert rules; "channels:manage"
configures notification destinations. Combine them, e.g.
["ingest", "read"].
expires_in: how long the key lives: "30d" (default), "90d", "1y" or "never".
The key outlives this session, so keep it short. A key with
alerts:manage or channels:manage cannot be "never" here; an admin issues
permanent management keys in the console.
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"] } }Give a CI job a key that manages alert rules for the next 90 days.
{ "name": "create_api_key",
"arguments": { "name": "ci-alerts", "scopes": ["alerts:manage"], "expires_in": "90d" } }Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "create_api_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | glassflow-connect-agent | |
| scopes | No | ||
| workspace | No | ||
| expires_in | No | 30d |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |