Skip to main content
Glama

Create a principal (user/agent) + API key

create_principal

Create a human user, agent, or service principal and issue a one-time API key with role, tenant, and scope restrictions for secure access control.

Instructions

Admin only. Create a principal (a human user, agent, or service) and issue its API key. Roles: admin, member, agent, viewer, auditor. The key is shown ONCE — store it securely; it can't be recovered (reissue by creating a new principal).

scopes is a comma-separated list of user_ids this principal may access, e.g. "cust_5521,cust_7788". Leave empty for unrestricted (the default, and correct for a single-tenant deployment). Set it for any multi-tenant deployment: without it, a valid key can read any space by passing that space's user_id. An admin role is unrestricted regardless, since org control implies reaching every space.

tenant is the org partition this key belongs to (default: the caller's own tenant). It is a HARD boundary: every store query is filtered by it, so a key for one tenant cannot reach another tenant's memory even under the same user_id. Set it per org in a shared multi-tenant deployment. Only the deployment operator (an admin of the "default" tenant) may name a different tenant.

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": {
      "name": "<name>"
    },
    "name": "create_principal"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNoagent
nameYes
roleNomember
scopesNo
tenantNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.11.0

TDQS

A4.5/5.0
Behavior5/5

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

Beyond annotations (which only say non-read-only, non-destructive, non-idempotent), the description adds the critical irreversible behavior: the key is shown ONCE and cannot be recovered, with the stated workaround of creating a new principal. It also explains the enforcement semantics of `tenant` as a hard query-time boundary and the admin-role exemption for scopes.

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 the admin restriction and the core action, then the one-time key warning, then per-parameter security detail — a sensible order. Some parenthetical asides ("the default, and correct for a single-tenant deployment") add length, but the density is justified for a security-sensitive operation.

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?

An output schema exists so return values need no explanation, and annotations cover the safety profile; the description supplies the missing security context around key loss and tenant isolation. Minor gaps remain, such as name-uniqueness behavior and what happens when a principal with the same name already exists.

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?

With 0% schema description coverage, the description carries the full burden and does so for the two non-obvious fields: `scopes` (comma-separated user_ids, empty = unrestricted, security consequence of omitting) and `tenant` (hard partition boundary, default = caller's tenant, only default-tenant admins may override). It also enumerates the role values and implies the kind values, though `name` and the `kind` field name itself are never explicitly addressed.

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?

"Create a principal (a human user, agent, or service) and issue its API key" names a specific verb and resource, and additionally discloses the side effect (key issuance) that the name alone doesn't reveal. An agent can distinguish this from list_principals or revoke_principal without opening any schema.

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

Usage Guidelines4/5

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

The description gives a clear precondition ("Admin only") and precise conditional guidance for the scopes parameter — empty for single-tenant, set for multi-tenant — plus when a caller may name a tenant. It does not explicitly contrast with sibling tools like revoke_principal or list_principals, but the create context is unambiguous.

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