Skip to main content
Glama

Set a Worker secret on a site

set_secret
Idempotent

Set a CF Worker secret on a site's deployed function. Value is encrypted-at-rest and accessible as env. inside the worker. Use for Stripe keys, Resend API keys, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYessecret name, UPPER_SNAKE_CASE; available as env.<NAME>
slugYessite slug whose function gets the secret
valueYessecret value (encrypted at rest), ≤8 KiB

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / name / description
      Added value: +"secret name, UPPER_SNAKE_CASE; available as env.<NAME>"
    • addedInput schema / properties / slug / description
      Added value: +"site slug whose function gets the secret"
    • addedInput schema / properties / value / description
      Added value: +"secret value (encrypted at rest), ≤8 KiB"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "result": {}
      +  },
      +  "required": [
      +    "result"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Beyond annotations (idempotentHint), the description discloses that the value is encrypted-at-rest and accessible as env.<NAME> inside the worker. This adds meaningful behavioral context about runtime behavior and security properties beyond what annotations provide.

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 sentences: the first states the core action; the second adds encryption info and usage examples. No unnecessary words. Efficiently front-loaded with essential 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 a 3-parameter tool with high schema coverage, the description covers purpose, behavior, and usage context. It could mention overwrite behavior, but given idempotentHint, this omission is minor. Output schema exists and need not be described.

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?

While schema coverage is 100%, the description enriches parameter understanding by explaining that the value becomes an environment variable (env.<NAME>) and gives usage examples. This adds value beyond the schema's technical constraints.

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?

Description clearly states the tool sets a Cloudflare Worker secret on a site's deployed function, with specific examples (Stripe keys, Resend API keys). It distinguishes from siblings like set_variable by emphasizing the encrypted-at-rest property and environment variable accessibility.

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?

The description provides examples of when to use the tool (for sensitive keys), but does not explicitly state when not to use it or mention alternatives like set_variable for non-secret settings. The guidance is implicit rather than explicit.

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