Skip to main content
Glama

upsert_page

Create a page if no ID is given, or rename an existing page if an ID is provided. Returns the page ID; refreshing the canvas sidebar displays the new or renamed page.

Instructions

无 id 创建页面,有 id 改名。返回页面 id。画布是项目结构的实时投影——已打开的画布标签刷新一下,新/改名页面就出现在左侧侧边栏,无需重新调用 render_canvas

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNo
dirNo覆盖默认工作目录(项目所在父目录);相对路径按当前工作目录解析;缺省用 PROTOFLOW_HOME 或启动时的 cwd
nameYes
projectIdYes项目 id(同时也是项目文件夹名)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/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 real work: it discloses the side-effect model (canvas is a real-time projection; refreshing shows new/renamed pages), the return value (page id), and explicitly preempts a redundant render_canvas call. It does not cover error/edge behavior (e.g., duplicate names, failed renames), but the disclosed behavior substantially exceeds a bare 'create or rename a page'.

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?

Two compact sentences with the core upsert logic front-loaded, followed by return value and the canvas side-effect note. Each sentence earns its place — the canvas projection detail is especially valuable because it prevents an unnecessary tool call, and there is zero filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter, no-output-schema, no-annotation tool, the description covers the primary calling path well: create/rename conditions, return format, and post-call behavior. It omits edge-case expectations such as duplicate-name handling, whether a rename is reversible, and error conditions, which leaves moderate gaps for an upsert operation.

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 50% (dir and projectId documented; id and name bare). The description compensates for the most semantically important gap by explaining that id selects the create/rename branch — meaningful value beyond the schema. However, name (the rename target) gets no explicit meaning, and dir's behavior relies entirely on the schema description, so compensation is partial.

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 explains the upsert semantics explicitly — 'with no id create a page, with id rename' — giving a specific verb, resource, and behavioral branch. It distinguishes the tool by its page-level operation, but it never explicitly differentiates from the sibling upsert_artboard (or notes the page-vs-artboard boundary), so it stops short of full differentiation.

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

Usage Guidelines3/5

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

The description gives clear condition-based guidance: presence of id selects rename vs create, and it explicitly tells the agent not to call render_canvas afterward because the canvas is a live projection. However, it does not address when to choose this tool over alternatives such as upsert_artboard or create_project, so usage context is implied rather than fully specified.

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