Skip to main content
Glama

session_preload

Replace the session's document-start preload group (empty array clears). Sources run before each new document's own scripts — including inline tags — which is the only hook that beats pages whose signing layer captures window.fetch/XHR natives at parse time (xhs's inline jsvmp). Set before the first navigate; applies to every navigation from then on.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recipeNoBuiltin recipe name appended after `scripts` (e.g. "xhs-sign"): the maintained document-start wrapper for that site — same source the engine auto-mounts on its navigations, without pasting JS. Unknown names are an error, not a silent no-op.
scriptsNoFull JS sources, in order. Sources run before each new document's own scripts (including inline ones) — the only hook that beats pages whose signing layer captures window.fetch/XHR natives at parse time. `[]` clears the group. Set before the session's first navigate and it applies to every navigation from then on.
session_idYesSession ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / recipe
      Added value: +{
      +  "default": null,
      +  "description": "Builtin recipe name appended after `scripts` (e.g. \"xhs-sign\"): the\nmaintained document-start wrapper for that site — same source the\nengine auto-mounts on its navigations, without pasting JS. Unknown\nnames are an error, not a silent no-op.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  2. Added

TDQS

A3.9/5.0
Behavior4/5

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

No annotations beyond a title, so the description carries the full load — and it does disclose key traits: replace semantics, that an empty array clears, that sources run before the document's inline scripts, and that the group persists across all navigations. It omits what happens if a source throws and whether the current document is affected.

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?

Front-loaded with the action ("Replace...") and the clearing rule, then the timing rationale. It is denser than needed — em-dashes and stacked subclauses — but every clause is informative and there is no filler.

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 stateful session-mutation tool with no output schema and only a title annotation, the description supplies the timing, persistence, and hook-mechanism context an agent needs to call it correctly. Error handling and return behavior are the only notable gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents session_id, recipe, and scripts in detail. The description reinforces the ordering/clearing semantics of scripts but adds no syntax or format beyond what the schema states, matching the baseline for high-coverage schemas.

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?

States a specific verb and resource: "Replace the session's document-start preload group." The mechanism description (runs before the document's own scripts, including inline ones) clearly signals how this differs from an eval/post-load hook. It does not name a sibling explicitly, so it falls short of a 5.

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?

Gives concrete timing guidance — "Set before the first navigate; applies to every navigation from then on" — and explains why a document-start hook is needed (beating parse-time native capture). This is clear usage context, but it never names alternatives (e.g. session_eval) or states when this is the wrong choice.

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.