Get API Key
get_api_keyRetrieve an API key's details—name, expiry, status, last four characters—masked by default, and optionally reveal it or write the full key to a file for the user.
Instructions
Read one API key of a project, enabled or disabled: name, expiry, active, last 4 characters. The key is masked unless revealToken is true; set that only when the user asks to see the key. To hand the key to the user without showing it here, give tokenPath and it is written to that file (a new file; an existing one is replaced only with overwrite: true). Requires "API keys: Read".
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": {
"projectId": "<projectId>",
"keyId": "<keyId>"
},
"name": "get_api_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyId | Yes | API key id, from list_api_keys or create_api_key (the "id" field, not the key itself). | |
| overwrite | No | Replace the file at tokenPath if it exists. Default false: an existing file is refused. Set it only when the user wants that file replaced. | |
| projectId | Yes | Project id (UUID), from list_projects or create_project. | |
| tokenPath | No | Write the full API key to this file (absolute, or relative to the folder MAGICLANE_FILES_DIR names when the server has one, otherwise the server's working directory), created readable only by the user where the system supports it. An existing file is replaced only with overwrite: true, and a network path is refused. A path that starts with ~/ or ~user/ is refused: ~ is not read as a home folder. The key itself is not put in the result. | |
| revealToken | No | Return the full API key in the result. Default false: the key is masked (only its last 4 characters). Set true only when the user asks to see the key; prefer tokenPath when it is available. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | The API key, masked unless the full key was asked for. | |
| notes | Yes | Things to know about this result. |