Set up the script
Install the TypeSafe provider, then exportCOMPOSIO_API_KEY and TYPESAFE_API_KEY in your shell. The TypeScript version requires Node.js 24.17 or newer.
Choose, complete, and execute
Save the following script.username represents a value supplied by your application or a user form. The request asks Jev to choose among three tools, and knownArguments supplies values only for the tool they belong to.
- Python
- TypeScript
select-tool.py
kind: 'partial', tool: 'HACKERNEWS_GET_USER', and missing: [['username']]. Confidence scores depend on the request and model version.
The partial call is expected: Jev can select the tool but does not generate the username. execute combines the arguments from Jev with the values your code supplies. Caller values take precedence. If a required value is still missing, execution raises TypesafeIncompleteDecisionError before calling the tool.
When you adapt this script, collect missing values from your application or ask the user for them. The suggestions field can contain uncertain model answers; treat those as candidates to review, not confirmed input.
Try an abstention
Changerequest to Explain what Hacker News is without using any tools, then run the script again. If Jev returns abstain, the script prints its reason and exits without executing. The model may also abstain when no tool fits or confidence is too low.
Keep API failures separate from abstentions. A timeout or invalid TypeSafe key raises an error, so it appears as a failed run instead of “No tool call.”
Shortlist tools for another provider
If you already use an LLM to choose arguments, ask Jev to narrow its tool list first. This separate script ranks up to 50 Hacker News tools, keeps three, and converts them to OpenAI’s tool format. It does not call OpenAI or execute a tool. Install the OpenAI provider alongside the packages above:- Python
- TypeScript
shortlist-tools.py
tools to your OpenAI agent. Shortlisting selects candidates; your agent still chooses which candidate to call and supplies its arguments.