Skip to main content
Glama

set_logpoints

Replace all logpoints on a page in one call: add locations that log expressions to the console on execution, remove omitted ones, or pass an empty list to clear. No pausing or source edits.

Instructions

Set the complete set of logpoints of the selected page: logpoints not in the list are removed, new ones are added, and an empty list removes all. A logpoint logs expressions to the console every time a line executes, without pausing or changing the source, like logpoints in the DevTools Sources panel. Locations are script URLs or original source files resolved through source maps (not available with --no-source-maps; scripts in workers and out-of-process iframes are not supported). A location in a generated script moves to its original source line when a source map covers it, and locations on the same line become one logpoint with the last expression. Output appears in list_console_messages; an expression that throws produces an error message without text. Logpoints survive reloads and navigations until removed or the page is closed. The response lists the resulting logpoints and where they are bound.

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": {
      "pageId": "<pageId>",
      "logpoints": "<logpoints>"
    },
    "name": "set_logpoints"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageIdYesTargets a specific page by ID.
logpointsYesLogpoints formatted as <url>:<lineNumber>[:<columnNumber>] <expression>. The url is a script URL or the path of an original source file from a source map, exact or as a path suffix (e.g. "src/app.ts"). Line and column numbers are 1-based in the coordinates of the url; a line without executable code moves to the next possible location. The expression is evaluated like console.log() arguments in the scope of the location, where local variables are accessible by their original names, and runs before the line executes, so a variable declared on that line is not set yet. list_console_messages shows objects as [object Object]: read them with get_console_message, or log JSON.stringify(value) for plain data. Example: "src/cart.ts:42 'cart total:', cart.total, cart.items.length". Pass an empty array to remove all logpoints.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false; the description carries substantial extra behavior: full replacement semantics, persistence across reloads and navigations, source-map remapping of locations, same-line collapsing to the last expression, thrown expressions yielding text-less console errors, and the response listing resulting logpoints and bindings. It also documents where effects surface (list_console_messages) and how to inspect objects (get_console_message).

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 most important fact (it replaces the entire set) before edge cases, and nearly every sentence adds operational value. It is dense for a single paragraph and repeats a little of what the schema already says about source maps, but nothing is wasted.

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 two-parameter mutation tool with no output schema, the description covers preconditions, mutation semantics, persistence, output destination, error behavior, and return contents. An agent has everything needed to invoke it correctly and interpret results.

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% and the schema already documents the <url>:<line>:<column> <expression> format, 1-based numbering, and suffix matching; baseline would be 3. The description adds meaning the schema lacks: source-map resolution of generated locations to original source, collision behavior on the same line (last expression wins), and the empty-list removal case.

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?

"Set the complete set of logpoints of the selected page" states a specific verb and resource and immediately defines the replace-set semantics (removals, additions, empty list clears all). No sibling tool in the catalog manages logpoints, so the operation is unambiguously distinct from list_console_messages or evaluate_script.

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 description explains the intended use case clearly: logging expressions on every line execution without pausing or modifying source, analogous to DevTools logpoints. It also lists concrete constraints (not with --no-source-maps, unsupported in workers and out-of-process iframes) and routes output reading to list_console_messages. It stops short of explicitly contrasting with alternatives such as evaluate_script or breakpoint-style debugging, so no exclusion guidance.

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