Skip to main content
Glama

exec_function_preview

Execute PostgreSQL functions with parameters to preview results for data exploration and analysis in the workbench-mcp environment.

Instructions

Execute a PostgreSQL function with positional parameters and return preview rows.

Use this tool for function calls such as sales."Fn_GetSalesChamps"(2, 2025, ARRAY[1,2,5], 5).

Pass arguments in positional order using JSON-compatible values:

  • scalars: 2, 2025, 5

  • arrays: [1, 2, 5]

  • null: null

PostgreSQL array parameters should be passed as normal lists; psycopg adapts them to PostgreSQL arrays automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
function_nameYes
parametersNo
max_rowsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool executes PostgreSQL functions and returns preview rows, but doesn't mention important behavioral aspects like error handling, transaction behavior, permission requirements, or rate limits. The description adds some value with the parameter format guidance but leaves significant gaps.

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?

The description is efficiently structured with a clear purpose statement upfront, followed by usage guidance and detailed parameter format examples. Every sentence adds value - no redundant information. The formatting with bullet points enhances readability without wasting space.

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

Completeness4/5

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

Given the complexity of executing database functions with 3 parameters and 0% schema coverage, the description does an excellent job explaining parameter semantics. However, with no annotations and a mutation tool (function execution), it should ideally mention more about behavioral aspects like side effects or error handling. The existence of an output schema reduces the need to describe return values.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by explaining all three parameters: 'function_name' (shown in example), 'parameters' (detailed format guidance with examples for scalars, arrays, and null), and 'max_rows' (implied by 'preview rows' and 'max_rows' parameter name). It provides crucial semantic information about PostgreSQL array handling that isn't in the schema.

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 the specific action ('Execute a PostgreSQL function with positional parameters and return preview rows') and distinguishes it from siblings like 'exec_proc_preview' (for procedures) and 'execute_readonly_sql' (for SQL queries). It provides a concrete example showing the exact type of operation.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('for function calls such as...'), but doesn't explicitly state when NOT to use it or mention alternatives like 'exec_proc_preview' for stored procedures. The example helps clarify the intended use case.

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/antonov2010/mcp-dev'

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