Skip to main content
Glama

batch_fn_define

Register functions for batch map, filter, or reduce operations. Define a named function with source code, optionally as a reducer for accumulation tasks.

Instructions

[batch] Register a named function. def fn(item): ... for map/filter. def fn(acc, item): ... for reduce (is_reducer=True).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
sourceYes
is_reducerNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must cover behavior. It explains function signatures but omits important details like scope, persistence, error handling, and return value of registration.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with code examples, no unnecessary words. Efficiently conveys the core information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers basic registration behavior but lacks details on return values, function lifecycle, and interaction with other batch tools. Adequate for a simple tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the description explains all parameters (name, source, is_reducer) with examples, adding significant meaning beyond the schema's title and type.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it registers a named function for batch operations, with specific examples for map/filter and reduce signatures. This distinguishes it from sibling tools like batch_batch_map and batch_batch_reduce.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides minimal guidance on when to use which function signature (map/filter vs reduce based on is_reducer), but does not discuss when to use this tool vs alternatives like batch_builtin_fns.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/0-co/agent-friend'

If you have feedback or need assistance with the MCP directory API, please join our Discord server