insert_equation
[MAINTENANCE] 51a595e7 — write an OMML equation DIRECTLY into a stored document's source .docx (real OOXML write-back), collapsing the manual resolve->open->parse->splice->rewrite->reindex flow into one call. The document must already be stored in the doc-structure store via ingest_document (whic...
This record as markdown: /tools/io-github-ajc3xc-meridian/insert-equation.md
What insert_equation does on Meridian
AI agents use insert_equation to create or update resources in Meridian, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Meridian environment.
| Parameter | Type | Required | Description |
|---|---|---|---|
doc | string | Yes | The stored document's source (the path you ingested it under via ingest_document; must resolve to a .docx on disk). |
para_id | string | Yes | Target paragraph id — its w14:paraId, or the synthesized 'p{index}' id surfaced as element_id by the read tools. |
position | string | — | Where to place the equation relative to the paragraph. Default 'append' (inline, end of paragraph). |
project_id | string | — | |
project_name | string | — | Project name — an alternative to project_id; resolved to the id internally. project_id wins if both are given. |
equation_id_or_omml | string | Yes | An existing indexed equation id (reuses its OMML), OR raw OMML XML (starts with '<'), OR a LaTeX source string. |
Parameters from the server's own tool schema.
Why insert_equation is rated Medium
This tool creates or modifies data (OOXML equations in .docx documents) with reversible effects—equations can be edited or removed. It does not delete irreversibly, execute arbitrary code, or move money.
From the tool's definition Tool description explicitly states 'write an OMML equation DIRECTLY into a stored document's source .docx (real OOXML write-back)' and 'rewrite' operations that modify filesystem source paths.
Attacks that exploit this kind of access
The rule that runs insert_equation safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Meridian, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For insert_equation, this is the rule to start with:
insert_equation stays usable, but capped: an agent stuck in a loop can't make hundreds of changes a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Meridian, apply this rule, and every insert_equation call is checked against it from then on.
Questions about insert_equation
[MAINTENANCE] 51a595e7 — write an OMML equation DIRECTLY into a stored document's source .docx (real OOXML write-back), collapsing the manual resolve->open->parse->splice->rewrite->reindex flow into one call. The document must already be stored in the doc-structure store via ingest_document (which registers a docx/latex document's structure here) AND have a filesystem source path to write back to. Locate the target paragraph by para_id — the paragraph's w14:paraId (or the synthesized 'p{index}' id that get_document_structure / find_similar_equation surface as element_id). equation_id_or_omml is resolved in order: the id of an equation already indexed for THIS document (its stored OMML is reused); else a string starting with '<' is raw OMML XML; else a LaTeX source (converted best-effort via latex2mathml -> MathML -> OOXML). position controls placement: 'append' (default) drops the <m:oMath> inline at the end of the paragraph; 'before'/'after' add it as its own display-equation paragraph adjacent to the target. After the write the document's equation index is resynced from the modified file (no separate re-verify step). Returns {document_id, source, para_id, position, omml, resync} on success, or {error} for a bad para_id / unresolvable equation / missing file (the file is never mutated when resolution fails). Persistent-state disclosure: on hosted Meridian, supplied text and project/session metadata are sent to and stored in Meridian's service; self-hosted deployments keep them in the configured local SQLite/Postgres database. This data is visible in the dashboard/API and later project context or handoffs. Delete individual tasks, notes, or decisions where supported, or delete the project/account using the documented controls. Do not include secrets. It is categorised as a Write tool in the Meridian MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
insert_equation accepts 6 parameters: doc, para_id, position, project_id, project_name, equation_id_or_omml. Required: doc, para_id, equation_id_or_omml. The full parameter table on this page comes from the server's own tool schema.
Register the Meridian MCP server in PolicyLayer and add a rule for insert_equation: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Meridian. Nothing to install.
insert_equation is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the insert_equation rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for insert_equation. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
insert_equation is provided by the Meridian MCP server (@meridianmcp/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Meridian, and thousands of servers like it.
This server
Across the catalogue