{"ok":true,"site":{"host":"lemma-webmcp.netlify.app","url":"https://lemma-webmcp.netlify.app/","type":"live","desc":"A live LaTeX pad where humans and agents co-author math. Block-anchored editing, real-time KaTeX rendering, and a render-error feedback loop that lets agents correct their own mistakes. Built…","tools":[{"name":"list_documents","kind":"answer","impl":"imperative","description":"List every LaTeX document in this workspace with title, block count, open render errors, and a short snippet. Use this first to discover document IDs before reading or editing.","title":"List workspace documents","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"query":{"type":"string","description":"Optional text filter matched against document titles and content."}}},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"get_document","kind":"answer","impl":"imperative","description":"Read one document's full structure: every block with its stable ID, LaTeX source, render status, and comment threads. This is the primary way to understand the document before editing. Always call this before insert_blocks or update_block.","title":"Read document structure","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID from list_documents."},"includeComments":{"type":"boolean","description":"Include comment threads in the response. Default true."}},"required":["documentId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"get_render_errors","kind":"answer","impl":"imperative","description":"Get every live KaTeX render error in a document: block ID, error message, character position, source context, and a suggested fix when one is known. Use this after any edit to verify the document compiles, and to find and repair your own mistakes.","title":"Read live render errors","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID from list_documents."},"blockId":{"type":"string","description":"Optional: restrict the check to a single block."}},"required":["documentId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"get_document_outline","kind":"answer","impl":"imperative","description":"Get a compact outline of a document: section headings, numbered theorems, and labeled equations with their numbers and block IDs. Much lighter than get_document. Use it to orient yourself or to pick anchor block IDs before editing.","title":"Read document outline","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID from list_documents."}},"required":["documentId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"search_documents","kind":"answer","impl":"imperative","description":"Find text or LaTeX across the workspace (case-insensitive substring). Returns each match as a block with its ID and surrounding context, so the agent can quote, update, or comment on it. Use before editing to locate where a concept, label, or command appears.","title":"Search workspace content","annotations":{"readOnlyHint":true,"untrustedContentHint":true},"inputSchema":{"type":"object","properties":{"query":{"type":"string","description":"Text to find, e.g. 'pythagorean', 'thm:', '\\\\int'."},"documentId":{"type":"string","description":"Optional: restrict the search to one document. Default: all documents."}},"required":["query"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"create_document","kind":"act","impl":"imperative","description":"Create and open a new LaTeX document from a template (blank, notes, problem_set, exam, paper_section). Optionally seed it with initial blocks. Use when the user wants to start something new.","title":"Create document from template","inputSchema":{"type":"object","properties":{"title":{"type":"string","description":"Human-readable document title."},"template":{"type":"string","enum":["blank","notes","problem_set","exam","paper_section","demo"],"description":"Template that pre-loads typical structure: problem_set, exam, notes, paper_section, or blank."},"initialBlocks":{"type":"array","description":"Optional initial blocks as {type, latex} objects.","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","equation","align","theorem","figure","table","code","preamble"]},"latex":{"type":"string"}},"required":["type","latex"]}}},"required":["title","template"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"insert_blocks","kind":"act","impl":"imperative","description":"Insert new LaTeX blocks after an anchor block (or at the start). Blocks render immediately; the response reports each block's render status and the surrounding context so you can verify placement. figure blocks support TikZ diagrams (\\begin{tikzpicture}...\\end{tikzpicture}). Check get_render_errors afterward to self-correct.","title":"Insert LaTeX blocks","inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"Target document ID."},"afterBlockId":{"type":"string","description":"Insert after this block ID, or use \"start\" for the beginning."},"blocks":{"type":"array","description":"Blocks to insert, each {type, latex}.","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","equation","align","theorem","figure","table","code","preamble"],"description":"text (prose with inline $math$), equation (display math), align (multi-line), theorem, figure, table, code, preamble (macro definitions)."},"latex":{"type":"string","description":"LaTeX source for the block."}},"required":["type","latex"]}}},"required":["documentId","afterBlockId","blocks"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"update_block","kind":"act","impl":"imperative","description":"Replace (or append to) the LaTeX source of a single block by ID. The block re-renders immediately and the response reports the new render status. Use this to fix errors reported by get_render_errors. Prefer this over rewriting whole documents.","title":"Replace or append to a block","inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"Target document ID."},"blockId":{"type":"string","description":"Block ID to update."},"latex":{"type":"string","description":"New LaTeX source for the block."},"mode":{"type":"string","enum":["replace","append"],"description":"Replace the whole block (default) or append to it."}},"required":["documentId","blockId","latex"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"delete_block","kind":"transact","impl":"imperative","description":"Delete a single block (and its comment threads) by ID. The document re-renders without it. Only delete when the user asks for removal.","title":"Delete a block","inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"Target document ID."},"blockId":{"type":"string","description":"Block ID to delete."}},"required":["documentId","blockId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"undo_last_change","kind":"act","impl":"imperative","description":"Undo the most recent edit in a document, but only when it was made by the agent. If the user typed something more recently, the call refuses and explains why, so you never silently revert the user's work. Use this when the user asks you to take an edit back.","title":"Undo the last change","inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID from list_documents."}},"required":["documentId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"add_comment","kind":"act","impl":"imperative","description":"Add an agent-authored comment anchored to a block. The comment appears in the margin next to the rendered block, clearly marked as agent-authored. Use comments to explain, question, or tutor without changing the user's math.","title":"Comment on a block","inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"Target document ID."},"blockId":{"type":"string","description":"Block to anchor the comment to."},"text":{"type":"string","description":"Comment text. Inline $math$ is rendered."},"quote":{"type":"string","description":"Optional exact quote from the block to highlight."}},"required":["documentId","blockId","text"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"reply_to_comment","kind":"act","impl":"imperative","description":"Append an agent reply to an existing comment thread. Use this to answer questions the user asked in the margin, in context.","title":"Reply to a comment thread","inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"Target document ID."},"threadId":{"type":"string","description":"Thread ID to reply to."},"text":{"type":"string","description":"Reply text. Inline $math$ is rendered."}},"required":["documentId","threadId","text"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"resolve_comment","kind":"act","impl":"imperative","description":"Mark a comment thread resolved (or reopen it). Use when the discussion has concluded so the margin stays clean.","title":"Resolve a comment thread","inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"Target document ID."},"threadId":{"type":"string","description":"Thread ID to resolve."},"resolved":{"type":"boolean","description":"Resolve (default true) or reopen the thread."}},"required":["documentId","threadId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"set_view","kind":"act","impl":"imperative","description":"Control what the user sees: switch between source, preview, and split modes, and optionally scroll to a specific block. Use this to draw attention to an edit. For example, after fixing a render error, switch to preview and scroll to the corrected block.","title":"Control the user's view","inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"Target document ID."},"mode":{"type":"string","enum":["source","split","preview"],"description":"source shows LaTeX code, preview shows rendered math, split shows both."},"scrollToBlockId":{"type":"string","description":"Optional block ID to scroll into view."}},"required":["documentId","mode"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"export_document","kind":"act","impl":"imperative","description":"Compile the document into a complete, compilable .tex file (with preamble, geometry, theorem declarations, and TikZ when used) and download it for the user. Set returnContent to also receive the full .tex source in the response for verification. Use when they want to keep working in Overleaf or another LaTeX environment.","title":"Export document as .tex","inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document ID to export."},"returnContent":{"type":"boolean","description":"Include the full .tex source in the response (default false)."}},"required":["documentId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"filter_documents","kind":"act","impl":"declarative","description":"Filter the documents in the workspace sidebar by title or content. Use this when the user asks to find, search, or locate one of their documents.","inputSchema":{"type":"object","properties":{"query":{"type":"string","description":"Search documents…"}}},"__source":"spec","__declarative":true}],"category":"Health & Education","favicon":"/favicons/lemma-webmcp.netlify.app.svg","apiSurface":"spec","toolCount":16}}