Skip to main content
Glama
Next.js DevTools MCP

Next.js DevTools MCP

Official
by vercel

nextjs_call

Call a specific MCP tool on a running Next.js development server by providing its port, tool name, and optional arguments, after discovering available tools and input schemas.

Instructions

Call a specific MCP tool on a running Next.js development server.

REQUIREMENTS:

  • Port number of the target Next.js dev server

  • Tool name to execute

  • Optional arguments object (if the tool requires parameters)

Use 'nextjs_index' first to discover available servers, tools, and their input schemas. If 'nextjs_index' auto-discovery fails, ask the user for the port and call 'nextjs_index' again with the 'port' parameter.

IMPORTANT: When calling tools:

  • The 'args' parameter MUST be an object (e.g., {key: "value"}), NOT a string; null is treated the same as omitting it

  • If a tool doesn't require arguments, OMIT the 'args' parameter entirely - do NOT pass {} or "{}"

  • Check the tool's inputSchema from 'nextjs_index' to see what arguments are required

Common Next.js MCP tools include:

  • Error diagnostics (get compilation/runtime errors)

  • Route information (list all routes)

  • Build status (check compilation state)

  • Cache management (clear caches)

  • And more (varies by Next.js version)

Example usage:

  1. Call 'nextjs_index' to see servers and tools

  2. Call 'nextjs_call' with port=3000, toolName="get_errors" to get errors from server on port 3000

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": {
      "port": "<port>",
      "toolName": "<toolName>"
    },
    "name": "nextjs_call"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoArguments object to pass to the Next.js MCP tool. MUST be an object (e.g., {param: 'value'}), NOT a string. Only provide this parameter if the tool requires arguments - omit it entirely for tools that take no arguments; null is treated the same as omitting it. Use 'nextjs_index' to see the inputSchema for each tool.
portYesPort number of the Next.js dev server (required).
toolNameYesName of the Next.js MCP tool to call (required). Use 'nextjs_index' first to discover available tool names.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.4.2
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / properties / args / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": {},
      +    "propertyNames": {
      +      "type": "string"
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / args / description
      Added value: +"Arguments object to pass to the Next.js MCP tool. MUST be an object (e.g., {param: 'value'}), NOT a string. Only provide this parameter if the tool requires arguments - omit it entirely for tools that take no arguments; null is treated the same as omitting it. Use 'nextjs_index' to see the inputSchema for each tool."
    • removedInput schema / properties / args / type
      Removed value: -"string"
    • changedInput schema / properties / port / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "number"
      +]
    • addedInput schema / required
      Added value: +[
      +  "port",
      +  "toolName"
      +]
  2. First observedv0.3.10

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it lists prerequisites (port, tool name, optional args), warns about a common miscall (passing args as a string or an empty object), and lists the categories of underlying tools including cache management. It stops short of disclosing side effects of destructive downstream tools or error/return behavior, which would be needed for a 5.

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 a one-line purpose followed by clearly labeled requirements, warnings, and an example. It is somewhat long and the args-as-object rule is stated more than once, but every section is scannable and nothing is buried.

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?

For a generic proxy tool with no output schema and no annotations, the description supplies the discovery path, prerequisites, argument-type pitfalls, and a worked example. What remains unstated is failure behavior and whether downstream tool output is passed through verbatim, which matters for a tool that can invoke cache-clearing or other mutating operations.

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% and the parameter descriptions already state that 'args' must be an object and may be omitted, so the description's repeated warnings are largely redundant. It does add workflow meaning by tying 'toolName' validation to 'nextjs_index', but that is a modest increment over 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 first sentence gives a specific verb and resource: calling an arbitrary MCP tool hosted on a running Next.js dev server. It is immediately distinguishable from the sibling 'nextjs_index', which the description explicitly frames as the discovery step rather than the execution step.

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?

It states an explicit workflow: run 'nextjs_index' first to discover servers and tool names, and if auto-discovery fails, ask the user for the port and retry 'nextjs_index' with the port parameter. The example sequence reinforces the ordering, so an agent knows exactly what to do before calling this tool.

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

Deploy Server

Other Tools