Skip to main content
Glama

Validate a package.json manifest

validate_package_json
Read-onlyIdempotent

Validate the name, version, description, keywords, private, scripts and dependency fields of a package.json against npm 10.9.4 rules, with field-level diagnostics and references. When to use: Use before publishing or when npm rejects a manifest. Installation and publication are not simulated; other fields are listed as unchecked. Notes: No account or token needed. Example arguments: {"npm":"10","manifest":{"name":"my-package","version":"1.0.0","dependencies":{"lodash":"^4.17.21"}},"publish":true}

Input Schema

NameRequiredDescriptionDefault
npmYesnpm version selector: '10' or '10.9.4'.
publishNoApply publish-time rules (default false).
manifestYesThe package.json content as a JSON object.

Output Schema

NameRequiredDescriptionDefault
errorNo
scopeYes
validYes
sourceYes
diagnosticsYes
uncheckedFieldsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / manifest / description
      Added value: +"The package.json content as a JSON object."
    • addedInput schema / properties / npm / description
      Added value: +"npm version selector: '10' or '10.9.4'."
    • addedInput schema / properties / publish / description
      Added value: +"Apply publish-time rules (default false)."
  2. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, and openWorldHint=false. The description adds useful behavioral context beyond annotations: field-level diagnostics with references, the fact that installation/publication are not simulated, that other fields are unchecked, and that no account or token is needed.

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 main purpose is front-loaded, followed by compact when-to-use and notes sections. The example arguments are useful but slightly extra; overall the description is efficiently structured with little waste.

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?

Given an output schema and rich annotations, the description covers the remaining gaps an agent needs: validated fields, unchecked fields, simulation limits, authentication requirements, and a concrete call example. Nothing essential for correct invocation 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 description coverage is 100%, and the schema already documents the npm selector, publish default, and manifest object. The description's example arguments illustrate how to pass npm, manifest, and publish, but it does not add semantic explanation beyond what the schema provides, so the baseline of 3 is appropriate.

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

Purpose4/5

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

The description states a specific verb and resource: 'Validate ... a package.json against npm 10.9.4 rules', and lists the exact fields checked. It is clear what the tool does, but it does not explicitly distinguish itself from sibling tools such as validate_tsconfig or check_dependencies.

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?

It gives explicit when-to-use guidance: 'Use before publishing or when npm rejects a manifest', and adds exclusions such as installation/publication not being simulated and other fields being unchecked. No alternative tool is named, so it falls short of full when/when-not/alternatives coverage.

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