Skip to main content

cache_get

Retrieve a previously stored string value by key from the cache. Returns null when the key does not exist or has expired.

Parameters​

ParameterTypeRequiredDescription
keystringYesThe cache key to look up.

Response​

FieldTypeDescription
valuestring | nullThe stored value, or null if the key does not exist or has expired.

Example​

{
"key": "my-session-data"
}

Result:

{
"value": "{\"step\":3,\"items\":[\"a\",\"b\"]}"
}

Result (key not found or expired):

{
"value": null
}

Errors​

Each failure carries a precise code in the response. Argument-schema and server errors are JSON-RPC protocol errors; a rejected value is returned as a tool result with isError: true (so the agent can read the code and self-correct).

CodeWhenDelivered as
invalid_argumentsThe key argument is missing or the wrong type.protocol error (invalid_params)
invalid_cache_keyThe key is empty or contains a disallowed character such as :.tool error (isError)
tool_not_configuredThe cache backend is not available on this server.tool error (isError)
internal_errorAn unexpected error occurred while accessing the cache.protocol error (internal_error)
method_not_foundThe tool isn't available to your credential.protocol error (method_not_found)

Notes​

  • Cache entries are scoped to your credential: a personal credential's entries are private to you, while an organization credential shares one cache across the organization. Keys never cross that boundary.
  • Keys must not contain :.
  • Entries expire automatically after 1 hour (3600 seconds). There is no way to extend the expiry from within a tool call.