Skip to content

Read a file for a pack tool's call

View as Markdown
GET
/v1/tool-files/{artifactId}
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.

artifactId
required
string

The file value’s artifactId.

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

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.

Media typeapplication/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
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

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

Media typeapplication/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
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

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.

Media typeapplication/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
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

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.

Media typeapplication/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
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

See also