---
title: "corestack_deployments_shared_files_check"
url: https://docs.corefinity.com/mcp/tools/corestack_deployments_shared_files_check
type: tool
last_updated: 2026-11-13
feature: deployment-pipeline
related:
  - https://docs.corefinity.com/api/reference/deployments/check-site-deployment-shared-files.md
  - https://docs.corefinity.com/guides/sites/code-and-deployments/pipeline-stages.md
---
# corestack_deployments_shared_files_check

**Shared files check.** Before you start a deployment or a rehearsal: whether the settings file the platform needs (such as .env or app/etc/env.php) is where the deployment links it from, and how to create it if not. Starting is never refused for a missing file. Scope: read.

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

## When to use it

Before you start a deployment (`corestack_deployment_trigger`) or a rehearsal (`corestack_deployments_rehearse`), check that the settings file the platform needs (`.env` for Laravel, `app/etc/env.php` for Magento, `wp-config.php` for WordPress, `.env.local` and `install.lock` for Shopware, `config.php` for Shopware 5; a PHP site needs none of its own) is where the deployment links it from. A deployment or a rehearsal without it, and without a copy in the repository, stops at linking shared files, and the site keeps serving its current release.

The check only advises. A deployment or a rehearsal is never refused for its answer, and a file it reports `missing` may still come from the repository, which no check can see before the build. Tell the person what it found and let them decide: never wait for `state: ok` before starting, and never require the file to be created first. A refused check (below) holds nothing back either.

Each required file is looked for where the deployment takes it from, in order: the environment's shared folder; the live release's own copy, which a deployment moves into the shared folder and links back (a rehearsal links it); for a rehearsal, a flat `htdocs` folder (an environment not yet in the releases layout). A file in none of them is `missing`, and its `message` names the full path and where to create it over SFTP or SSH; if the repository ships its own copy, the deployment uses that copy instead. A file that is there (in the shared folder, the live release or a flat `htdocs`) but that the site cannot read, or one in the shared folder that leads outside the site, is `unreadable`, and its `message` names the copy. On Shopware, a deployment counts `install.lock` only in the shared folder, and a missing one means the shop has no database yet. A WordPress site built with Bedrock needs no `wp-config.php`. An environment deployed by upload answers `not_applicable`.

The answer is `{for, state, message, files[]}`: `state` is `ok`, `missing` (any file missing or unreadable) or `not_applicable`; each file has `path`, `shared_path`, `status` (`present`, `from_live_release`, `from_htdocs`, `missing`, `unreadable`) and `message`. Show the person the `message` of each missing or unreadable file, and say that a copy in their repository would be used instead.

The same check in the public REST API, with the same rules, refusals and scope: `GET /api/corestack/sites/{site}/deployments/shared-files?for=deployment`.

## Inputs

- `site_id` (integer, ≥ 1, required): The environment to deploy, or the non-production environment to rehearse on.
- `for` (string: `deployment` or `rehearsal`, default `deployment`): a rehearsal also takes a file from a flat `htdocs` folder.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "for": {
      "default": "deployment",
      "description": "deployment (the default) or rehearsal: a rehearsal also takes a file from a flat htdocs folder.",
      "enum": [
        "deployment",
        "rehearsal"
      ],
      "type": "string"
    },
    "site_id": {
      "description": "The environment to deploy, or the non-production environment to rehearse on.",
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id"
  ],
  "type": "object"
}
```

## Refusals

- `switched_off`: running commands on sites is switched off at the moment; the check reads the site's files, so it waits too.
- `not_running`: the site is not running; start it first.
- `temporarily_unavailable`: the site's files could not be read from the pod; try again in a moment.
- `rate_limited`: 10 checks a minute per person, shared with the Control Panel and the public API.
- 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_deployments_shared_files_check",
  "arguments": {
    "site_id": 4211,
    "for": "deployment"
  }
}
```

A Laravel environment whose `.env` is in neither place answers:

```json
{
  "for": "deployment",
  "state": "missing",
  "message": "1 file this environment needs is missing from its shared folder. You can still start, but the deployment will stop before it goes live.",
  "files": [
    {
      "path": ".env",
      "shared_path": "/var/www/shop.example.com/shared/.env",
      "status": "missing",
      "message": "/var/www/shop.example.com/shared/.env is not on this environment yet. Create it over SFTP or SSH before you deploy: without it the deployment stops at linking shared files, and the site keeps serving its current release. If your repository includes .env, the deployment keeps that copy instead."
    }
  ]
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_deployments_shared_files_check with site_id 4211, for deployment. (Shared files check.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [GET /api/corestack/sites/{site}/deployments/shared-files](https://docs.corefinity.com/api/reference/deployments/check-site-deployment-shared-files.md)
- Guide: [Pipeline](https://docs.corefinity.com/guides/sites/code-and-deployments/pipeline-stages.md)
