Tools & scopes

What an agent can do through the ApiVault MCP server: the tools it can call, the OAuth scopes that unlock them, and the errors it gets back when a call is refused.

Available tools

The server exposes six dedicated tools for browsing masked metadata, managing vault credentials, and decrypting secrets on-demand:

ToolRequired ScopeDescription
list_keyskeys:readList API keys with masked previews (sk_live_••••1234). Supports filtering by environment or service.
get_keykeys:readRetrieve metadata and masked preview for a single key by ID.
reveal_keykeys:revealDecrypt and return the raw secret value. Accepts optional vault_key for custom encryption accounts.
add_keykeys:writeStore a newly generated API key in the encrypted vault.
update_keykeys:writeUpdate metadata or re-encrypt secret values for an existing key.
delete_keykeys:writePermanently remove a key from the vault by ID.

OAuth scopes

During OAuth consent you select which permissions to grant:

The client icon is picked from the first source that loads: the logo_uri sent at registration, the favicon of its client_uri or of its HTTPS redirect URIs, a LobeHub icon matching the client name, a built-in icon for well-known clients, and finally a generic MCP icon. Only HTTPS logo_uri and client_uri values are stored.

ScopePermissionTools
keys:readView API keys (masked)list_keys, get_key
keys:writeAdd, update, and delete API keysadd_key, update_key, delete_key
keys:revealReveal decrypted secret valuesreveal_key

Manage or revoke connected agents anytime in Settings → MCP Connections.

Error codes

CodeMeaningAction
UNAUTHORIZEDToken missing or expiredTrigger re-authentication in your client
INSUFFICIENT_SCOPEToken lacks required scopeRe-authenticate with write or reveal scope granted
NOT_FOUNDKey ID invalidRe-list keys with list_keys
VAULT_KEY_REQUIREDCustom encryption; vault key neededPass vault_key in tool arguments
INVALID_VAULT_KEYWrong custom vault keySupply the correct vault key — repeated wrong guesses are throttled
VAULT_KEY_RATE_LIMITEDToo many incorrect vault keysWait for the delay in the error message before retrying
DUPLICATE_KEYKey with same name & environment existsUse update_key or choose another name

Vault key attempt limits

A custom vault key is verified against a stored hash, so incorrect keys passed to reveal_key, add_key or update_key are rate limited: 10 failures per 15 minutes, counted per user and per source address. Exceeding the limit returns VAULT_KEY_RATE_LIMITED (HTTP 429 with a Retry-After header), and the tool error states how long to wait.

A correct vault key clears the counter, so an agent that reveals several keys in a row is never throttled. Agents should not retry a rejected vault_keyautomatically — ask the user for the correct one instead.

Rejected attempts are visible, not silent: a failed tool call is written to the project's audit log with its HTTP status, the error code above, the acting user and the client name the agent reports, filed under the action that was attempted — so a denied reveal_key appears as a KEY_REVEALED entry with a 4xx status. Calls rejected before a project can be resolved are not logged, because entries are stored per project.