Balancing Tool Granularity

  • Too fine-grained – explosion of tool count and choice overload for LLM.
  • Too coarse-grained – excessive complexity of a single tool.

Criterion for merging – similarity of functions and overlap of scenarios: extract_pdf_text, extract_docx_content, and extract_pptx_content are better combined into read_document with a file_type parameter.

Do not merge if parameter sets differ significantly or the function is used extremely frequently.

More than ~100 tools – even state-of-the-art models make mistakes in selection.

Related: Art of Tool Description