skill_read_asset
Read asset files from a skill directory safely. Retrieves text or base64-encoded content with MIME type and truncation status, preventing path traversal and limiting size.
Instructions
function_purpose: Read a specific asset file within a skill (returns text or base64 data).
Description:
Safely reads an asset inside a skill directory, preventing path traversal and limiting size via max_bytes.
Returns UTF-8 text when possible, otherwise base64-encoded bytes, including a MIME type guess and truncation flag.
Args:
name: str The hyphen-case skill name (must match skill directory)
path: str Relative file path within the skill directory
max_bytes: int Maximum number of bytes to read (default: 8_388_608)
Returns:
dict[str, Any] with:
encoding: "text" | "base64"
data: str UTF-8 text or base64 string
mime_type: str | None Best-effort MIME type guess
truncated: bool True if content was cut at max_bytes
Usage:
Use after listing assets to fetch the content of a specific file for analysis or display.
If the asset is large, consider increasing max_bytes or reading only required portions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| path | Yes | ||
| max_bytes | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||