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.

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).
  • 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).
  • 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.

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.