Skip to main content
Glama
worldnine

Scrapbox Cosense MCP Server

delete_lines

Delete exact lines or contiguous line blocks from a Scrapbox page by full-text match, optionally removing every occurrence while protecting the title line.

Instructions

Delete one or more lines from a Scrapbox page on cosense (scrapbox). Matches the target by exact text. If targetLineText contains newline characters, it is matched as a contiguous block of lines and removed as a whole. By default only the first match is removed; set matchAll to remove every (non-overlapping) occurrence. Refuses to delete the title line (the first line), which would rename or remove the page — use delete_page for that. Returns an error if no match is found. Requires COSENSE_MCP_PAT or COSENSE_SID. Uses my-cosense-project project as default if projectName is not specified.

Input Schema

NameRequiredDescriptionDefault
matchAllNoIf true, delete every occurrence of the target (a single line or a contiguous block). Block matches are non-overlapping. The operation is atomic: if any match includes the title line, the whole call is refused. Defaults to false (delete only the first match).
pageTitleYesTitle of the page to modify
projectNameNoTarget project name. If not specified, defaults to 'my-cosense-project'.
targetLineTextYesExact text of the line(s) to delete. Matching is case-sensitive and requires full-line exact matches. If it contains newline characters, the consecutive lines are matched as a contiguous block and removed as a whole.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.10.1

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses exact-text matching semantics, newline block matching, the matchAll atomicity/refusal rule, the title-line guard, the no-match error, and the required credential (COSENSE_MCP_PAT or COSENSE_SID). Only the success return payload goes unstated, which is minor for a delete tool.

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, then ordered by importance: matching semantics, matchAll, the title-line guard, error behavior, auth, default project. Every sentence carries information, though the trailing default-project sentence duplicates the schema and could be dropped.

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?

No annotations and no output schema, and the description still covers auth, defaults, edge cases, refusal behavior, and error signaling — enough for correct invocation. It stops short of describing what a successful call returns or whether deleted content is recoverable, which is the remaining gap given there is no output schema.

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 description coverage is 100%, so the schema already documents all four parameters including the matchAll atomicity rule and the projectName default; the baseline is 3. The description mostly restates those defaults ('my-cosense-project', first-match default) rather than adding new parameter semantics.

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?

States a specific verb and resource — 'Delete one or more lines from a Scrapbox page' — and immediately distinguishes itself from the closest-looking sibling by noting it refuses the title line and that delete_page is the tool for page removal. An agent can tell delete_lines apart from delete_page and edit_lines without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit conditional guidance: default behavior deletes only the first match, matchAll deletes every non-overlapping occurrence, title-line targets are refused and should route to delete_page instead. It also states the failure condition ('Returns an error if no match is found'), so the agent knows both the selection condition and the exclusion.

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