Skip to main content
Glama

Set Function Policy

set_function_policy

Create or update the server-owned access policy of a backend function (functions/.js). Without a policy a function answers only to the app owner's Studio token (401 for app visitors and webhooks). Recipes: anonymous checkout step or inbound webhook/IPN -> require_auth=false; signed-in members -> require_auth=true + allowed_roles (e.g. ['authenticated'] or ['admin','staff']); webhook with a shared secret -> require_secret=true + secret_name (an app secret) that the caller sends in secret_header. allowed_hosts fences the function's outbound network to those hosts plus the platform backend; omit it for open egress.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYesThe app ID
functionYesFunction name, e.g. takbull_create (file functions/takbull_create.js)
secret_nameNoName of the app secret holding the shared value (set_secret)
require_authYesfalse = anonymous visitors and external callers may invoke
sdk_identityNoWhose identity the SDK inside the function uses. 'caller' (default): the function reads data as whoever called it, so an anonymous call sees only what anonymous may read. 'app': the SDK acts as the app owner on THIS app's entities (a checkout or payment IPN that must load/update orders whose read policy is owner/admin/staff); the caller still counts as anonymous for rate limits, audit and X-FSe2-Caller-Type. Owner-only. Omit to keep the stored value
allowed_hostsNoOutbound egress allow-list of host[:port] entries, e.g. ['api.takbull.co.il']. Omit to keep the stored list; pass [] to open egress again
allowed_rolesNoApp roles allowed when require_auth is true; 'authenticated' = any signed-in app member
secret_headerNoHeader the caller sends the shared secret inx-fse2-secret
require_secretNoCaller must send a shared secret header (webhooks)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / sdk_identity
      Added value: +{
      +  "description": "Whose identity the SDK inside the function uses. 'caller' (default): the function reads data as whoever called it, so an anonymous call sees only what anonymous may read. 'app': the SDK acts as the app owner on THIS app's entities (a checkout or payment IPN that must load/update orders whose read policy is owner/admin/staff); the caller still counts as anonymous for rate limits, audit and X-FSe2-Caller-Type. Owner-only. Omit to keep the stored value",
      +  "enum": [
      +    "caller",
      +    "app"
      +  ],
      +  "type": "string"
      +}
  2. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only contain false hints, so the description carries the burden and largely succeeds. It discloses that without a policy the function 401s app visitors/webhooks, that allowed_hosts fences outbound egress to listed hosts plus the platform backend, and that the operation is create-or-update. It does not explicitly discuss partial update semantics for omitted fields, but the schema covers those per-parameter behaviors.

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 a single dense paragraph, front-loaded with the core action and resource, followed by terse, high-value recipes. Every clause earns its place; the length is justified by the need to cover nine parameters and multiple policy patterns.

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

Completeness5/5

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

For a 9-parameter mutation tool with no output schema, the description covers default behavior, usage recipes, egress semantics, and role/secret configuration. No obvious gap prevents an agent from selecting the right policy pattern and providing the correct parameters.

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?

Schema coverage is 100%, so baseline is 3, but the description adds substantial cross-parameter meaning. The recipes connect require_auth to allowed_roles, require_secret to secret_name/secret_header, and clarify allowed_hosts omission behavior. This goes well beyond the individual parameter descriptions.

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 opening clause 'Create or update the server-owned access policy of a backend function (functions/<name>.js)' states a specific verb, resource, and scope. This clearly differentiates the tool from sibling policy tools like set_entity_policy and set_route_policy without needing to open their schemas.

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 'Recipes:' section provides explicit scenario-to-parameter mappings: anonymous checkout/webhook maps to require_auth=false, signed-in members to require_auth=true with allowed_roles, and shared-secret webhooks to require_secret=true. It also explains the policy-absent 401 behavior. It does not name alternative tools, but it gives clear context for when this tool applies.

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