EasyDeepLearn

What does an ideal function-calling schema look like?

medium

Answer

  • (1) Descriptive name (verbobject)(\mathrm{verb}_{\mathrm{object}}): searchorders\mathrm{search}_{\mathrm{orders}}, not f1.
  • (2) Human-readable description explaining when to use it.
  • (3) JSON Schema for parameters with required fields, type, description per field, enum for constrained values, format for dates/emails.
  • (4) Examples in the description if the signature is subtle.
  • (5) Return schema: describe what the tool returns so the LLM can interpret results.
  • (6) Keep the tool set small (~5-15) — larger sets need retrieval-based tool selection.
Check yourself — multiple choice
  • Random function names
  • Verbobject\mathrm{Verb}_{\mathrm{object}} name + rich description + JSON Schema args (types, descriptions, enums, formats) + return schema + few examples
  • Only names matter
  • Same across all tools

Function schema: name + description + full JSON schema args + return type + examples.

#function-calling#agents#tools

Practise LLMs & GenAI

214 interview questions in this topic.

Related questions