Skip to main content
Glama

Turn text into JSON

shape_text_to_json
Read-onlyIdempotent

Turn pasted key:value notes, CSV/TSV, or Markdown tables into typed JSON via deterministic parsing, so plain-text records become clean, reliable data without manual guessing.

Instructions

Turn pasted text (key: value notes, CSV/TSV or a Markdown table) into typed JSON.

Use this when you have plain-text records or a table in the conversation and need clean JSON you can trust, without guessing values yourself. It is plain code, not an AI model, so the same text always gives the same JSON and nothing is made up. Do not use it when the text is already JSON, is nested data, is app logs, or is a file on disk (use shape_file_to_json for files).

format: "auto" (default) picks for you. Or force "kv" (key: value or key=value lines, a blank line starts a new record), "csv" (comma, semicolon, tab or | separated, first row is the header) or "markdown" (a | pipe | table, first row is the header).

Returns {"format": , "data": }. data is a list of records for CSV and tables. For key: value text it is one object, or a list when blank lines split it into several records. Keys become lower_snake_case. Numbers become numbers, yes/no and true/false become booleans, empty or "null" becomes null.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "shape_text_to_json"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe text to turn into JSON: key: value lines, CSV/TSV or a Markdown table.
formatNoInput format. "auto" picks for you; "kv" = key: value lines, "csv" = CSV/TSV, "markdown" = a pipe table.auto

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, and the description adds substantive context beyond them: the tool is deterministic plain code rather than a model, so identical input yields identical output with no invented values. It also discloses the exact return envelope and the type-coercion and key-normalization rules, which annotations cannot express.

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?

Front-loaded with purpose, then usage, then mode semantics, then output shape — a sensible reading order with no filler. It runs slightly long in the returns paragraph, but every sentence carries actionable detail (coercion rules, record/list distinction) rather than restating the name.

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

Completeness5/5

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

There is no output schema, and the description compensates by describing the {"format", "data"} return and when data is an object versus a list. For a two-parameter, low-complexity tool, an agent has everything needed to select and invoke it correctly.

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 coverage is 100%, so the 3 baseline is already met by structured fields. The description still adds real meaning the schema lacks: what "auto" does, that a blank line starts a new record in "kv", which delimiters "csv" accepts, that the first row is the header for csv/markdown, and that markdown means a pipe table.

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?

States a specific verb and resource ("Turn pasted text ... into typed JSON") plus the accepted input shapes (key: value notes, CSV/TSV, Markdown table). It also distinguishes itself from the file-based sibling by scoping to text "in the conversation," so an agent can pick correctly without opening the schema.

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

Usage Guidelines5/5

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

Explicit positive trigger ("Use this when you have plain-text records or a table in the conversation") and an explicit exclusion list (already-JSON, nested data, app logs, file on disk) that names the alternative tool, shape_file_to_json. Both when-to-use and when-not-to-use are covered with no inference required.

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