# Write cache entry

Tool: `veryfront__write_cache_entry`

Create or replace one cache entry. ttl\_seconds defaults to 300. Requires project.cache.write.

## Arguments

| Name                | Type                                   | Required | Description                                                                                                                         |
| ------------------- | -------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `project_reference` | string                                 |          | Project ID or slug; optional on a project-scoped connection                                                                         |
| `key`               | string · min length 1 · max length 512 | Yes      | Cache key, 1 to 512 characters: letters, digits, underscore, colon, dot, hyphen and slash. No "." or ".." segments between slashes. |
| `value`             | string                                 | Yes      | UTF-8 string value. Values over 1 KB are stored compressed.                                                                         |
| `ttl_seconds`       | integer · min 1 · max 86400            |          | Seconds until the entry expires, 1 to 86400. Defaults to 300 when omitted; the previous TTL is never kept.                          |

## Responses

| Status | Description                                           |
| ------ | ----------------------------------------------------- |
| 200    | The tool ran; its output is result.structuredContent. |

## Call it

```bash
curl -X POST -N "https://api.veryfront.com/mcp" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Accept: application/json, text/event-stream" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__write_cache_entry",
    "arguments": {
      "key": "a",
      "value": "string"
    }
  }
}'
```

## Example response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"key\":\"string\",\"expires_at\":\"2026-01-01T00:00:00Z\"}"
      }
    ],
    "structuredContent": {
      "key": "string",
      "expires_at": "2026-01-01T00:00:00Z"
    }
  }
}
```
