Skip to main content
Glama
worldnine

Scrapbox Cosense MCP Server

edit_lines

Replace specific lines in a Scrapbox page by matching exact text and substituting new content, optionally across all occurrences.

Instructions

Replace one or more lines in a Scrapbox page on cosense (scrapbox). Matches the target by exact text and substitutes it with new content (which may span multiple lines). If targetLineText contains newline characters, it is matched as a contiguous block of lines, so any n lines can be replaced with m lines. By default only the first match is replaced; set matchAll to replace every (non-overlapping) occurrence. Returns an error if no match is found. Requires COSENSE_SID. Uses my-cosense-project project as default if projectName is not specified.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoContent format of newText. 'markdown' (default) converts Markdown to Scrapbox syntax. 'scrapbox' passes content through as-is, preserving Scrapbox-native indentation and syntax.
newTextYesReplacement content in markdown format (default) or Scrapbox syntax (when format is 'scrapbox'). May contain multiple lines separated by newline characters.
matchAllNoIf true, replace every occurrence of the target (a single line or a contiguous block). Block matches are non-overlapping. Defaults to false (replace 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 replace. 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 replaced as a whole.
Behavior5/5

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

With no annotations, the description fully discloses behavior: exact, case-sensitive matching; contiguous newline-block replacement; non-overlapping matchAll; error on missing match; and COSENSE_SID requirement. This gives an agent strong information about side effects and failure modes.

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?

The description is compact, front-loaded, and has no filler. Every sentence adds a meaningful behavior or default, while keeping the total length reasonable for a six-parameter tool.

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 mutation tool with no output schema and no annotations, the description is complete: it covers purpose, matching semantics, default behavior, multi-line replacement, project fallback, auth, and error conditions. This gives an agent everything needed to select and invoke the tool effectively.

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%, and the schema already explains targetLineText, newText, format, matchAll, and projectName. The description adds only marginal context beyond the schema, such as 'any n lines can be replaced with m lines' and the no-match error, but not enough to move far beyond the schema baseline.

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 opens with 'Replace one or more lines in a Scrapbox page on cosense (scrapbox)', a specific verb and resource. It clearly frames edit_lines as replacement behavior, distinguishing it from insert_lines and delete_lines.

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 gives clear context: exact-text matching, block replacement, first-match default, matchAll option, no-match errors, and auth requirement. It does not explicitly name sibling tools as alternatives or exclusions, but it is easy for an agent to infer when replacement is appropriate.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/worldnine/scrapbox-cosense-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server