Skip to main content
Glama

provider_keys

Store, list, test, and remove encrypted model provider API keys, falling back to environment variables. Never returns keys, only hints and source.

Instructions

Model provider keys stored encrypted (table provider_keys; the portal's Settings > Model keys). A stored key is used before the provider's environment variable (GOOGLE_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, AZURE_OPENAI_API_KEY). No action ever returns a key: only its hint (last four characters), who set it and when. action: list (per provider: source = portal | environment | none, the stored default key and named credentials; can_store is false, with the reason in problem, when the server has no SECRET_KEY) | set (provider + value, optional name; refused when SECRET_KEY is unset: a key is never stored as plain text) | remove (provider, optional name, confirm=true; the provider falls back to its environment variable) | test (provider, optional name: asks the provider for its model list and returns {ok, source, detail}, with the provider's own error on failure).

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

Input Schema

NameRequiredDescriptionDefault
envNoConfig branch: which `environment` rows of the AI config DB to read/write. staging = the editable working set (default); prod = what production serves.staging
nameNo'' = the provider's default key. A name stores a second, named credential that a model selects with extra_config.credential.
valueNoset: the key to store. It is encrypted and never returned by any tool.
actionYeslist = where each provider's key comes from; set = store or replace a key; remove = delete a stored key; test = one free call to the provider with the key in use.
confirmNofalse (default) = dry run: report what WOULD change and change nothing. true = execute.
providerNogoogle_genai | openai | anthropic | azure_openai. Required for set, remove and test.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the whole burden and does so: keys are encrypted, no action ever returns a key (only a hint, setter, timestamp), set is refused when SECRET_KEY is unset so nothing is stored as plain text, list reports can_store=false with a reason in problem, and test makes a real provider call returning {ok, source, detail}. Remove's destructive nature is disclosed via the confirm=true requirement.

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 storage and precedence model, then a compact per-action breakdown. It is dense and slightly long, and the parenthetical action list compresses a lot into one block, but nearly every clause conveys operational information.

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?

Given six parameters, an output schema, and the security-sensitive nature of key management, the description covers storage, precedence, refusal conditions, dry-run default and error reporting. Nothing an agent needs to invoke it correctly appears to be missing.

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?

Schema coverage is 100%, so env, name, value, action, confirm and provider are all already documented in the schema. The description does note that remove needs confirm=true and that set takes provider+value with optional name, but this largely restates the schema rather than adding new meaning, so the baseline 3 applies.

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 the resource (encrypted model provider keys, table provider_keys, matching the portal's Settings > Model keys) and enumerates the four verbs it supports. It also states the precedence rule against provider environment variables, which makes the tool's role unambiguous against configuration siblings.

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?

Each action carries its own when-to-use context: list to see source per provider, set to store or replace, remove to delete and fall back to the environment variable, test to make a free call. It does not explicitly contrast with adjacent tools like api_keys or env_vars, so the agent still has to reason about the boundary.

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