Skip to main content
Glama

Wisp

Create function

create_function

Add a function with complete code (a new draft version, deployed for ?test). http true exposes it at / with one method; http false makes it background work (schedules, the console, MCP and functions.invoke run it; input arrives as req.body). Name it "before" or "after" for the special functions that run around every HTTP function (before(req): return a response to stop the call; after(req, res): return a changed response). JavaScript: export async function handler(req) { return { status: 200, body: {...} } }; Python: def handler(req): return {"status": 200, "body": {...}}. req has method, path, subpath, query, headers, body. Functions may use import { config, kv, table, file, functions } from "wisp".

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": {
      "project": "<project>",
      "name": "<name>",
      "code": "<code>"
    },
    "name": "create_function"
  }
}

Input Schema

NameRequiredDescriptionDefault
mcpNoA tool of the project's MCP server (default: public HTTP functions)
codeYes
httpNoExpose over HTTP (false for background work; always false for before/after)
nameYesName and URL segment: lowercase letters, digits, - or _
methodNoHTTP method (default GET; POST without HTTP)
projectYesProject id (p…) or address (slug)
languageNo
visibilityNoHTTP functions. private: only this project (its code, schedules, MCP server, console); internal: any project in the workspacepublic
descriptionNo
input_schemaNoJSON Schema (type object) of the query parameters (GET/DELETE) or JSON body (POST/PUT/PATCH, and functions without HTTP)
output_schemaNoJSON Schema of the JSON response

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and discloses important behavior: the function is created as a new draft version deployed for ?test, HTTP exposure versus background execution paths, and the control flow for before/after functions. It also provides runtime code shapes, req fields, and available wisp imports. It does not cover permissions, overwrite behavior for duplicate names, or error handling, which keeps it below a 5.

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

Conciseness4/5

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

The description is front-loaded with the core action and then explains execution modes, special function names, and code contracts. It is long but justified by the tool's complexity and 11 parameters. Some parenthetical and code-example detail adds bulk, but every major sentence contributes useful information.

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 an 11-parameter creation tool with no annotations and no output schema, the description covers the essential invocation contract: creation as a draft, HTTP versus background behavior, before/after semantics, runtime code examples, request shape, and available imports. It leaves out auth or permission requirements and what creation returns, but the schema already documents most parameters and the description need not explain return values without an output schema.

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?

Schema description coverage is 73%, so the baseline is 3, but the description adds meaningful semantics for several parameters. It explains http exposure versus background work, method implications, special name values, and that input arrives as req.body for non-HTTP functions. It does not add much beyond the schema for project, language, visibility, mcp, description, or output_schema, but the added meaning is substantial.

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 uses a specific verb and resource: "Add a function with complete code (a new draft version, deployed for ?test)." It clearly distinguishes creation from modification by specifying a new draft version and explains the special "before" and "after" function names. An agent can identify this as the creation tool without opening the schema.

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?

It explains key mode selection: http true exposes the function over HTTP, http false makes it background work, and before/after names trigger special wrapping functions. It does not explicitly name update_function as the alternative for existing functions or state when not to use this tool, but the creation context is clear.

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