Skip to main content
Glama

sb_code

Destructive

Inject tracking pixels, analytics, chat widgets, and site-wide CSS into page head, body start, or body end. Create, merge, or remove custom code files scoped to a site or single page.

Instructions

The site's custom code files — tracking pixels, analytics, chat widgets, site-wide CSS — injected at head, body_start or body_end of every page (no page_id) or one page. Create infers language from the extension, placement from the language. scss/typescript compile on write (compile_error). json/text: placement "none" only; an enabled site-wide "none" file is served at its url. action:"list" | "set" (no id creates; with id merges the named fields over the stored row) | "remove". Not the custom-code element.

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": {
      "action": "<action>"
    },
    "name": "sb_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNo
nameNo
actionYes
contentNo
dry_runNo
enabledNo
page_idNolist: that page's files plus site-wide; set: scope to it ("" = site-wide)
site_idNo
languageNo
positionNo
placementNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.103.0
    • changedInput schema / properties / language / enum
      Previous value: -[
      -  "html",
      -  "css",
      -  "javascript"
      -]New value: +[
      +  "html",
      +  "css",
      +  "javascript",
      +  "scss",
      +  "typescript",
      +  "json",
      +  "text"
      +]
    • changedInput schema / properties / placement / enum
      Previous value: -[
      -  "head",
      -  "body_start",
      -  "body_end"
      -]New value: +[
      +  "head",
      +  "body_start",
      +  "body_end",
      +  "none"
      +]
  2. Addedv0.89.0

TDQS

A4/5.0
Behavior4/5

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

Beyond the destructiveHint/openWorldHint annotations, it discloses non-obvious behaviors: scss/typescript compile on write (with compile_error), set merges named fields rather than replacing the row, and enabled site-wide 'none' files are served at their url. It does not explicitly state that 'remove' is irreversible or mention auth/permission requirements for a destructive write tool, leaving a gap.

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 resource and scope are front-loaded, and nearly every clause carries factual weight (extensions, compile, merge, json/text constraints). It is very dense and occasionally cryptic ('the custom-code element', terse merge phrasing), costing a bit of readability but not wasting space.

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 destructive mutation tool with no output schema, it covers scope, compile behavior, merge semantics, and format constraints well. Gaps remain around dry_run, position, enabled behavior, and what set/remove return, but overall it is sufficient to call the tool correctly in common cases.

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 only 9%, so the description must carry the burden — and it does substantially: it explains placement enum values, language inference from file extension, id create-vs-merge semantics, page_id scope (site-wide vs single page), and action values. It leaves several of the 11 parameters unexplained (dry_run, position, enabled, name), preventing a top score.

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 names a concrete resource (custom code files: tracking pixels, analytics, widgets, CSS) and its injection points (head/body_start/body_end), plus the action set (list/set/remove). This lets an agent distinguish the resource from generic page/node tools. The sibling differentiation 'Not the custom-code element' is real but cryptic — it doesn't name the sibling or explain the difference, so the boundary is only partly drawn.

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 gives concrete selection logic: no page_id = site-wide, page_id = one page; no id = create, with id = merge over stored row; json/text require placement 'none'. These conditions steer correct invocation. It stops short of explicit naming of an alternative tool, relying on the vague 'not the custom-code element' note.

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