Documentation

Agent Capabilities

Available tools and skills for interacting with PaperCast.

AST Integrity & Safety

Agents should never modify the underlying JSON AST directly by writing files. Always use the MCP tool modules provided below to manipulate the document state, orchestrate pagination, and manage browser sessions safely.

Session tools

Session tools manage the WebSocket connection between the AI agent and the browser tab.

  • get_active_sessions: Retrieves a list of all currently connected browser tabs.
  • select_active_session: Binds the agent to a specific browser tab so mutations broadcast to the correct window.

Workspace tools

Workspace tools manage the storage and lifecycle of schemas directly in the user's local indexed DB environment.

  • workspace_list_schemas: Lists all locally saved schemas.
  • workspace_load_schema: Loads a specific schema from local storage.
  • workspace_save_schema: Saves the current active schema to local storage.
  • workspace_create_schema: Creates a new blank schema file.
  • workspace_delete_schema: Deletes a saved schema from local storage.

Document tools

Document tools handle the global document schema, metadata, and structural headers.

  • get_document_state: Retrieves the current JSON schema from the browser.
  • set_document_state: Replaces the entire schema (rarely used, prefer surgical edits).
  • replace_document_body: Replaces the entire array of children in the document body.
  • update_document_data: Modifies the root JSON data object used for resolving bind variables.
  • update_document_meta: Modifies the document metadata (title, author, paper size).
  • update_document_theme: Adjusts global typography and color variables.
  • set_document_section: Creates or updates page regions (headers and footers). You can assign standard string conditions like "first", "last", "even", "odd", "all", or use complex object conditions like {"type": "custom", "expression": "pageNumber !== 1"}.
  • delete_document_section: Removes a header or footer definition.
  • set_page_override: Assigns a specific header or footer to a specific page number.

Layout tools

Layout tools provide safe, surgical AST manipulation for the main document body.

  • get_available_widgets: Lists the widgets registered in the browser's component registry.
  • get_layout_element: Retrieves a specific node by its ID.
  • insert_layout_element: Injects structural containers (row, column).
  • add_text_widget: Injects text and rich text elements.
  • add_table_widget: Scaffolds a complex data table.
  • delete_layout_element: Safely removes a node and cleans up references.
  • update_element_properties: Modifies a node's visual properties or data binding path.
  • patch_element_properties: Applies a partial update to a node's properties.
  • set_table_footer_rows: Configures calculation rows at the bottom of a data table.
  • add_node_to_table_footer_cell: Injects widgets into specific table footer cells.

Utility tools

Utility tools provide auxiliary logic and lookup functions that don't directly modify the AST.

  • search_icons: Performs a semantic search against the 1,400+ icon names in the lucide-react library. Use this to determine exactly which PascalCase name to pass to the IconNode iconName property.

PDF tools

PDF tools orchestrate document generation and export.

  • generate_pdf: Triggers the serverless Puppeteer flow to render the current document state as a downloadable PDF.

Skills tools

Skills tools allow agents to self-document and discover complex workflows.

  • list_papercast_skills: Returns a list of available AI skills (markdown files containing domain rules).
  • read_papercast_skill: Reads the content of a specific skill file to teach the agent how to perform a task.