---
title: "corestack_node_caches_clear"
url: https://docs.corefinity.com/mcp/tools/corestack_node_caches_clear
type: tool
last_updated: 2026-11-13
feature: node-runtime
related:
  - https://docs.corefinity.com/api/reference/runtime/clear-node-caches.md
  - https://docs.corefinity.com/guides/sites/software-and-services/node-js.md
---
# corestack_node_caches_clear

**Clear Node.js caches.** Clear a row's package-manager caches (npm, Corepack, pnpm, Yarn; all four unless named) and answer the bytes freed. Global packages and projects are untouched. Scope: write.

- Scope: `write`
- Runs as a task: no

## When to use it

Clear a row's package-manager caches (npm, Corepack, pnpm and Yarn; all four unless named) and answer the bytes freed. Global packages and projects are untouched.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `which` (array of `npm`, `corepack`, `pnpm`, `yarn`, each once)

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "site_id": {
      "description": "The row: the site or one of its environments.",
      "minimum": 1,
      "type": "integer"
    },
    "which": {
      "description": "The caches to clear, each once (default all four).",
      "items": {
        "enum": [
          "npm",
          "corepack",
          "pnpm",
          "yarn"
        ],
        "type": "string"
      },
      "maxItems": 4,
      "minItems": 1,
      "type": "array"
    }
  },
  "required": [
    "site_id"
  ],
  "type": "object"
}
```

## Refusals

- `switched_off`: commands are switched off.
- `not_running`, `busy`: the site is not running, or another command is.
- `managed_elsewhere` (message: "This site is managed by another control panel"): another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_node_caches_clear",
  "arguments": {
    "site_id": 4211,
    "which": ["npm"]
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_node_caches_clear with site_id 4211, which ["npm"]. (Clear Node.js caches.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [POST /api/corestack/sites/{site}/node-runtime/caches/clear](https://docs.corefinity.com/api/reference/runtime/clear-node-caches.md)
- Guide: [Node.js configuration](https://docs.corefinity.com/guides/sites/software-and-services/node-js.md)
