Skip to main content
Glama

env to JSON converter

hopi_env_to_json
Read-onlyIdempotent

Convert between a .env file and a JSON object. In env-to-json mode, each line is split on its first equals sign into a key and value, blank and commented lines are skipped, a leading export is removed, and matching surrounding quotes are stripped (double-quoted values also unescape \n); duplicate keys keep the last value. In json-to-env mode, a JSON object becomes KEY=value lines, quoting values that contain spaces, a hash or a newline. Source: https://hopi.co.uk/env-to-json/

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo'env-to-json' parses a .env file into JSON, 'json-to-env' turns a JSON object into .env lines (default env-to-json)env-to-json
textYesThe .env file text, or the JSON object text, depending on mode

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
outputYes
summaryYes
source_urlYesThe tool's page on hopi.co.uk (cite or open to check the figure)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / required
      Added value: +[
      +  "output",
      +  "source_url",
      +  "summary"
      +]
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

The description goes far beyond annotations by enumerating precise parsing rules: split on first equals, skip blank/commented lines, remove leading export, strip quotes, unescape \n, last duplicate key wins, and json-to-env quoting rules. This is rich behavioral context that readOnlyHint/idempotentHint/destructiveHint do not convey.

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

Conciseness5/5

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

One dense, well-organized paragraph with the core purpose front-loaded, followed by mode-specific rules. Every sentence earns its place, the edge cases are covered, and the source URL is a useful extra without padding.

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?

The description is complete for a two-mode converter: parsing rules, escaping behaviors, duplicate handling, and both directions are covered. The schema documents parameters and defaults, and an output schema exists for return values. Nothing essential is missing.

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

Parameters3/5

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

Schema coverage is 100%: both mode and text are documented with descriptions, and the mode enum values are explained. The tool description elaborates on behavior but does not add parameter-level detail beyond what the schema already provides, so the baseline 3 applies.

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, resource, and both directions: 'Convert between a .env file and a JSON object'. This clearly differentiates it from sibling conversion tools like hopi_csv_to_json or hopi_json_to_csv, since .env is a distinct format.

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?

The description makes usage context unambiguous: use it when a .env file needs to become JSON or vice versa. It does not explicitly name alternatives or when-not-to-use, but no sibling tool targets .env format, so the context is clear and no exclusions are needed.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources