Skip to main content

show_file_excerpt

Shows the content of a public text file inline in the chat bubble. Use when a user asks to see file contents, or when the agent wants to quote a specific section of a document. Only works for text-based files (.txt, .md, .csv, .json, .yaml, .xml, .html, etc.). For binary files, use present_public_file instead.

Parameters

Returns

On failure (file not in manifest, binary extension, or read error):

Examples

Show the first 50 lines (default)

Show a specific section

Show a specific CSV section

Show the header row plus rows 1–9 of a CSV:

Page through a large file (custom tool)


Call from your own custom tool

Notes

  • Only registered when the agent has public files.
  • Binary extensions (.pdf, .png, .jpg, .docx, .xlsx, archives, etc.) are rejected with a suggested_tool hint.
  • To offer the full file as a download instead of showing it inline, use present_public_file.