Skip to main content
Glama

format_lab_entry

Convert structured entry lists into formatted lab book text, auto-filling exact LCMS retention times, areas, and m/z values from linked PDFs.

Instructions

Format a list of entry dicts into a structured lab book text entry.

Takes a list of typed entry dicts (or a JSON string) and produces a formatted lab book entry. The tool re-parses LCMS PDFs to fill in exact numbers — you only provide peak identifications (name, approximate RT, ion) as search keys.

IMPORTANT: Do NOT write free-form LCMS text. Use the structured entry types below. The tool will look up the actual RT, area%, m/z, and UV from the PDF.

Entry types and their required fields:

{"type": "text", "content": "Procedure paragraph or section header..."}

{"type": "lcms-species", "file": "path/to/report.pdf", "label": "t = 0 min", "peaks": [ {"name": "Product", "rt": 1.02, "ion": {"mode": "ES-", "mz": 444.1}}, {"name": "SM", "rt": 0.65, "ion": {"mode": "ES+", "mz": 275.1}}, {"name": "TPPO", "rt": 1.02, "ion": {"mode": "ES+", "mz": 279.1}} ]}

{"type": "lcms-areas", "file": "path/to/report.pdf", "label": "t = 10 min", "peaks": [ {"name": "Product", "rt": 1.03, "compound_related": true}, {"name": "Byproduct", "rt": 1.26, "compound_related": false} ]}

{"type": "lcms-species", "file": "path/to/report.pdf", "label": "Purified product", "peaks": [ {"name": "Product", "rt": 1.01, "ion": {"mode": "ES-", "mz": 444.2}, "purity": true, "detector": "220nm"} ]}

{"type": "lcms-manual", "file": "path/to/manual_integration.pdf", "label": "Manual LC", "peaks": [ {"name": "Product", "rt": 1.01, "compound_related": true} ]}

{"type": "nmr", "content": "1H NMR (400 MHz, DMSO-d6): ..."}

Workflow: First call parse_analysis_file on each PDF to see peaks/masses. Then build entries referencing those PDFs with approximate RT and ion as search keys. This tool re-reads the PDF and fills in exact numbers.

Args: entries_json: List of entry dicts, or a JSON string, or {"entries": [...]}. output_path: If given, write the formatted text to this file and return {ok, output_path, size} instead of {ok, text}.

Returns: Dict with keys: ok, text (formatted lab book entry string). When output_path is provided, returns {ok, output_path, size} instead.

Safety override: Format a lab entry and atomically publish verified text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
output_pathNo
entries_jsonYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full disclosure burden, and it does so well. It reveals the key behavioral trait — 're-parses LCMS PDFs to fill in exact numbers' and 'look up the actual RT, area%, m/z, and UV from the PDF' — so the agent knows inputs are approximate search keys. It also discloses both return shapes ({ok, text} vs {ok, output_path, size}). The 'Safety override' line mentioning 'atomically publish verified text' is slightly cryptic and not fully reconciled with the stated returns, but it does gesture at an unstated publishing side-effect. No annotation contradiction exists since none are provided.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long, but front-loaded with purpose and a critical warning. Each section earns its place: the entry-type examples are verbose yet necessary because the schema provides zero structure for these payloads. The workflow, args, and returns sections are tight. Minor deduplication exists (entry-type example for 'lcms-species' appears twice with different fields), and the 'Safety override' line is tangential, but overall the length is justified by the schema gap.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (five entry types, nested peak/ion structures, PDF re-parsing, two return modes) and 0% schema coverage, the description covers nearly everything needed to call it correctly: entry schemas, required fields, workflow, parameter forms, and return behavior. The main gap is failure handling — what happens when a search-key match fails or a PDF can't be re-parsed — but for the task of formatting entries, the essential calling contract is fully specified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must fully compensate — and it does. entries_json is documented with all three accepted shapes ('List of entry dicts, or a JSON string, or {"entries": [...]}'), and output_path is explained with its effect on the return value (write to file and return path/size instead of text). The extensive entry-type examples actually document the nested structure that the schema (additionalProperties: true) leaves opaque. This adds real meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Format'), a precise input ('a list of typed entry dicts or a JSON string'), and a concrete outcome ('a structured lab book text entry'). It clearly distinguishes itself from siblings like parse_analysis_file (which parses, not formats) and assemble_lab_book (which assembles a full book, this formats single entries). An agent can tell exactly what this tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides an explicit workflow: 'First call parse_analysis_file on each PDF to see peaks/masses. Then build entries referencing those PDFs...' This directly names the sibling prerequisite and sequencing. It also gives a negative constraint ('Do NOT write free-form LCMS text'). It doesn't list exclusions for when NOT to use this tool (e.g., for non-LCMS formatting alternatives), but the positive guidance is strong and actionable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ZiChenWang114514/cdxml-toolkit-community'

If you have feedback or need assistance with the MCP directory API, please join our Discord server