Cortex · Prompt and contextTool guides (
Tool guides (guide)
A tool’s guide says how to use it, and is kept with the tool: Cortex puts the guides of a run’s active tools into one system message, TOOL GUIDES, after instructions. The tool’s description and input schema are sent with the tool itself, not in the prompt.
const seatsLeft = defineTool({
id: 'seatsLeft',
name: 'seatsLeft',
description: 'How many seats are left on a night',
input: z.object({ night: z.string() }),
guide: ['Pass the night as YYYY-MM-DD.', 'A night with no show answers left: 0.'],
execute: ({ night }) => ({ night, left: seatsLeftOn(night) }),
});
const desk = defineAgent({ id: 'desk', instructions: '…', tools: [seatsLeft] });TOOL GUIDES — how to use the tools on this run: ── seatsLeft ── Pass the night as YYYY-MM-DD. A night with no show answers left: 0.
[
{
name: 'seatsLeft',
description: 'How many seats are left on a night',
parameters: ['night'],
},
{ name: 'respond' },
]Runs in this page on the installed package. The input and the expected output are defined by the example.