![]() |
The tools of the server | ![]() |
The agent sees a list of tools, each with a description and its arguments; this page tells what they are for. Every tool which works on a document takes document: the identifier given by open_document (d1, d2…) or the absolute path of the file, which is then opened.
The documents of this session, and the files which another TeXmacs of the user has open, with the mode in which the agent works on them.
Opens a file by its path (the same document if it is already open).
The title and the sections (with their level, labels and size). The first thing to ask for a long document.
The content of the document or of a node, as text (the default and the cheapest), TeXmacs, an s-expression, LaTeX or Markdown, by pieces if it is large.
Searches text, tags (tag:theorem), labels and sections.
The labels, the references and the citations, and the references which point nowhere or the labels which are defined twice.
They are not offered when TEXMACS_MCP_READONLY is set; nor are withdraw_proposal, save_document, close_document and create_document. Each call is one step which can be undone, and it is applied entirely or not at all. An edit says the hash of the node as the agent read it; if the node has changed since, the answer is a conflict with the current content.
Replaces a node by new content.
Inserts content before or after a node, or at the beginning or the end of the document or of a node.
Deletes a node.
Changes a word or a sentence in a node (old becomes new); the best tool for small corrections.
Undoes the last steps of the agent. It does not undo what you did, and it cannot undo a proposal.
The new content can be given as TeXmacs, as an s-expression, as LaTeX or as Markdown. It is parsed first, and refused if it does not parse or if it breaks the rules of What an agent may not do.
The proposals of the agent in a document, with their state (pending, accepted, rejected, withdrawn).
Takes a pending proposal back; your document returns to the old text.
Saves the document to its file. If you have the file open and the agent is not in the direct mode, the save is refused: you save.
Closes the document; refused when it has unsaved changes, unless it is asked to discard them.
Creates a new .tm file (the path is absolute, the folder exists, the file does not) with a style and optionally a content, and opens it.
There is no tool which runs code, starts a session of a plug-in, changes your preferences or goes to the network.