Skip to main content
Glama

generateFunction

Generate a new function from a natural language prompt. Returns one or more code variations.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "prompt": "<prompt>"
    },
    "name": "generateFunction"
  }
}

Input Schema

NameRequiredDescriptionDefault
promptYesA natural language description of the function to generate.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false, so the agent knows this is a non-destructive write-ish operation; the description adds the notable behavior that it can return multiple code variations. However, it leaves a key ambiguity unresolved: whether the generated function is actually persisted/registered (implied by "Generate a new function") or merely returned as candidate code. That distinction matters given createFunction exists.

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 short sentences, zero filler, and the return behavior is front-loaded immediately after the purpose. Nothing is wasted or repeated.

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?

For a one-parameter tool with no output schema, the description covers what it does and gives a hint about the return value (one or more code variations). The main missing piece is whether the result is persisted as a real function or just returned as code, which matters given the createFunction sibling.

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

Parameters3/5

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

There is a single parameter with 100% schema description coverage ("A natural language description of the function to generate"), so the schema already carries the semantics. The description adds nothing beyond it, which is the baseline case for a high-coverage single-parameter schema.

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

Purpose4/5

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

"Generate a new function from a natural language prompt" gives a specific verb (generate) plus resource (function) and adds a distinguishing qualifier: the input is natural language, which separates it from code-supplying siblings like createFunction or updateFunctionCode. It stops short of naming any sibling explicitly, so an agent must infer the boundary.

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?

There is no explicit when-to-use or when-not-to-use statement and no named alternative among the many function siblings. The "from a natural language prompt" phrasing implicitly signals the use case (idea-to-code generation rather than supplying code), which is enough to be an implied guideline but not a stated one.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources