# Read a file for a pack tool's call

GET

/v1/tool-files/{artifactId}

```sh
curl --request GET \
  --url https://example.com/v1/tool-files/example
```

A pack tool that declares `readsFiles` gets the call’s tool files with each call, and its pack service reads each file the tool asks for here, by its file value’s `artifactId`. No API key: `Authorization: Bearer` carries the call’s token (`kgi_tf_…`). The call reads a file its run may be shown, such as one in the run’s input, in its conversation, or one a tool stored in it, with the bytes it was stored with, never a copy made for a model. A read isn’t refused for a closing or suspended workspace or a suspended project: it changes nothing. The token closes when the call answers, when its time passes, or when its run ends.

## Parameters

### Path Parameters

**artifactId**

required

string

The file value’s `artifactId`.

## Responses

### 200

The file’s bytes, as it was stored (`application/octet-stream`, as an attachment, never sniffed); or no bytes, and why, as JSON (`notRead`).

string format: binary

### 404

`tool-file-token-not-found`: no tool call’s files match the bearer (none sent, an unknown token, a wrong secret, and a call that doesn’t read files alike), or this runtime stores no files.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 409

`tool-file-token-closed`: the call has answered, its time has passed, or its run has ended.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 429

`rate-limit-exceeded`: too many requests from this client in a minute, counted before the token is looked up, so nothing was read. `Retry-After` says when to read the file again.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 503

`tool-files-busy`: the runtime’s memory for files had no room for the bytes in time, so nothing was read. `database-busy`: the database was too busy to answer in time. `Retry-After` says when to read the file again.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

## See also

- [Kindgi 0.4.0](https://docs.kindgi.com/v0.5.0/releases/0.4.0.md)
- [Error code `database-busy`](https://docs.kindgi.com/v0.5.0/reference/errors.md#database-busy)
- [Error code `rate-limit-exceeded`](https://docs.kindgi.com/v0.5.0/reference/errors.md#rate-limit-exceeded)
- [Error code `tool-file-token-closed`](https://docs.kindgi.com/v0.5.0/reference/errors.md#tool-file-token-closed)
- [Error code `tool-file-token-not-found`](https://docs.kindgi.com/v0.5.0/reference/errors.md#tool-file-token-not-found)
- [Error code `tool-files-busy`](https://docs.kindgi.com/v0.5.0/reference/errors.md#tool-files-busy)
- [Every error code](https://docs.kindgi.com/v0.5.0/reference/errors.md)
