# fs_share

A link for the user to one file of a computer, opened on their CMDOP page; audio and video play there. Lasts 1h, 1d (default) or 7d.

**In short:** A [server tool](https://docs.cmdop.ai/reference/tools.md#server-tools): the server answers it from its own record, so it works while every machine is off. Over MCP call `fs_share`; over HTTP send `"tool": "fs_share"` to [`POST /api/v1/call`](https://docs.cmdop.ai/reference/http/post-call.md) without `machine`.

## Arguments

| Name | Type | Required | Meaning |
| --- | --- | --- | --- |
| `expires` | `"1h" \| "1d" \| "7d"` | no | How long the link works: `1h`, `1d` (default) or `7d`. |
| `machine` | `string` | yes | The computer: its id or unique name, as `machines_list` shows it. |
| `path` | `string` | yes | The file's absolute path on that computer. Folders are refused. |

## Result

| Name | Type | Required | Meaning |
| --- | --- | --- | --- |
| `expires_at` | `integer` | yes | When the link stops working, unix seconds. |
| `name` | `string` | yes | The file's name. |
| `size` | `integer` | yes | Bytes. |
| `type` | `string` | yes | The media type the link serves. |
| `url` | `string` | yes | The link. It opens the file in the user's browser, signed in to their CMDOP page; give it to them as it is. |

## Examples

**MCP**

```json
{
  "name": "fs_share",
  "arguments": {
    "machine": "<machine>",
    "path": "<path>"
  }
}
```

**HTTP**

```bash
curl -sS -X POST "https://<contour>.cmdop.dev/api/v1/call" \
  -H "Authorization: Bearer $CMDOP_TOKEN" \
  -H "x-cmdop: 1" \
  -H "Content-Type: application/json" \
  -d '{"tool":"fs_share","args":{"machine":"<machine>","path":"<path>"}}'
```

## Limits

The token is the only check: no risk class applies, and the call is not counted against the plan. A call with `machine` set, or with `sealed` instead of `args`, returns [`bad_args`](https://docs.cmdop.ai/reference/errors/bad_args.md). A refused call returns one of the [error codes](https://docs.cmdop.ai/reference/errors.md).
