Skip to main content
Glama

Update function

function_update
Idempotent

Update a TypeScript edge function (Deno runtime). When code is provided it is typechecked before it is saved; read /.kliv/edge/kliv-edge-api.md for the kliv-edge SDK surface. Expose a chatbot tool with tool: {description, parameters}; select its tool_name in chatbot_connection_set tools.

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": {
      "name": "<name>",
      "explanation": "<explanation>",
      "account": "<account>"
    },
    "name": "function_update"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNoOptional. TypeScript edge function code (Deno), typechecked before save. Starter: import { defineEdgeFunction, json } from "kliv-edge"; export default defineEdgeFunction(async ({ request }) => json({ path: new URL(request.url).pathname })); A raw (request) => Response default export also works. Use the single EdgeContext argument for platform capabilities, not request headers. Secrets: secrets.get(name) / secrets.require(name). kliv-edge is the only supported bare import; npm:, jsr:, and URL imports are allowed. Read /.kliv/edge/kliv-edge-api.md; kliv-edge-api.d.ts and examples/ are beside it. Read-only reference; save code through this tool.
nameYesFunction name
pathNoURL path (optional)
roleNohead supplies crawler link-preview metadata; requires access_policy public. null unmarks the hook. Omit to retain the role.
toolNoOmit to preserve; null on update removes the binding.
accountYesAccount (app) UUID; call account_list to find it
descriptionNoFunction description (optional)
explanationYesWhy you are making this call, in one sentence for the user.
access_fieldNoField to check for group_match (use 'groups') or metadata_match (a server-managed user metadata key, e.g. 'department'; user-editable metadata is never matched)
access_policyNoAccess policy: public, authenticated, group_match, metadata_match, or entitlement_match (optional)
access_match_typeNoMatch type: equals or contains (the caller holds this value), intersects (the caller holds any value in this JSON array)
access_match_valueNoValue to match. For group_match, an app-role key like 'editors', or a group uuid. 'manage-team' admits every team's founders and managers, so it is not an app-admin check. For intersects, a JSON array of them
access_match_featuresNoJSON array of feature lookup_keys for entitlement_match (e.g. '["subscribers","pro-tier"]'). The function is callable iff the visitor holds an active entitlement to any listed feature.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare non-destructive, idempotent, closed-world mutation, so the description is not carrying safety disclosure. What it does add beyond the schema is real: typecheck-before-save and the requirement to read /.kliv/edge/kliv-edge-api.md for the SDK surface. Still missing is what actually happens on save (rebuild/deploy, propagation delay) and how a failed typecheck surfaces.

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?

Three front-loaded sentences with no filler; the core action comes first and the doc pointer second. Minor waste from restating the typecheck constraint that the code parameter description already carries verbatim.

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?

For a 13-parameter mutation tool with no output schema, the description covers the code-authoring path well but says nothing about the return value or what the saved function state looks like afterward. The access_policy/entitlement family is left entirely to the schema, which is adequate but leaves the definition slightly thin for a tool this large.

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 coverage is 100%, so baseline is 3; the description earns the extra point by explaining cross-parameter behavior the schema does not — that exposing a chatbot tool requires tool_name to be selected in chatbot_connection_set tools, and by routing the agent to the API doc for authoring code. It adds no syntax help for the access_* group beyond what the schema already documents.

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?

The description uses a specific verb and resource ("Update a TypeScript edge function (Deno runtime)") and names the runtime, which is genuinely discriminating. It does not, however, distinguish itself from the sibling function_replace or function_create, so an agent must infer the update-vs-replace boundary from schema alone.

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 gives useful conditional guidance for one branch ("When code is provided it is typechecked") and explains the chatbot-tool sub-case with a pointer to chatbot_connection_set tools. It never states when to choose this over function_replace, nor what prerequisites exist (e.g., function must already exist), leaving the main routing decision implied.

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