# Agents Can Fix Their Own Argument Typos, If the Server Tells Them

> An agent sent timeoutMs 420 times to a tool that takes timeoutSec, so every wait ran the 45-second default. How FrontMCP tells the agent which key it meant.

Source: https://frontmcp.dev/blog/agents-fix-their-own-typos
Published: 2026-11-28
Author: David Antoon
Updated: 2026-11-28
Example version: FrontMCP 1.13.2
Technical checks recorded: 2026-11-27
Scope: Dated article; use the maintained reference for current instructions. Its presence in a release snapshot does not verify its code against that release.

*[Illustration: Agents can fix their own typos. An agent stands on a small island at the lower left. Above the gap between it and a server's island floats the card of its call to wait_for_task: the line timeoutMs: 1800000 is struck through, and timeoutSec: 1800 is written under it. On the server stands the wait tool, a block with a clock on its face, and above it a speech bubble asks: did you mean timeoutSec?]*

An agent asked a build tool to wait half an hour. It kept getting an answer after 45 seconds. On one team’s servers, the agent made the same call 420 times across 192 sessions. [The team’s bug report](https://github.com/agentfront/frontmcp/issues/1481)

The tool expected a timeout in seconds, under `timeoutSec`. The agent sent milliseconds under `timeoutMs`. The tool’s Zod schema dropped the unknown key, so every call used the default. Nothing in the reply told the agent what had gone wrong.

Since FrontMCP 1.13.0, the reply names the ignored argument and suggests a close match for a top-level typo, and since 1.13.2 for a nested one. Here that gives the agent a way to correct both the spelling and the units on its next call.

The team worked around the typo by converting `timeoutMs` to seconds and rejecting any other unknown key in an [`Around('validateInput')` hook](https://frontmcp.dev/reference/sdk/hooks#wrapping-a-stage).

<a id="what-the-agent-sees-since-frontmcp-113"></a>

## What the agent sees since FrontMCP 1.13

In this Playground, `build-42` is a simulated build that takes ten minutes. The tool answers immediately with the status a real wait would see. With the default `warn` policy, the **Call** tab shows two lines. The tool reports that the build is still running. FrontMCP tells the agent it ignored `timeoutMs` and suggests `timeoutSec`.

```text
build-42 is still running after 45 s.
These arguments are not declared and were ignored: 'timeoutMs' (did you mean 'timeoutSec'?).
```

*[Illustration: The timeout typo, in four numbered steps between the agent, the Playground’s client, and the agent-team server, whose wait tool, wait_for_task, has a stopwatch on its face. The server keeps the default policy, undeclaredKeys warn, and the work happens there. 1: the agent sends tools/call wait_for_task with taskId build-42 and timeoutMs 1800000. 2: timeoutMs is ignored, so the wait runs its default, 45 s. 3: the reply says build-42 is still running after 45 s, and FrontMCP adds the line These arguments are not declared and were ignored: 'timeoutMs' (did you mean 'timeoutSec'?). 4: the agent sends the corrected call, with timeoutSec 1800, and gets back build-42 finished after 600 s.]*

**Runnable example: A misspelled timeout triggers a warning.**

Initial call configuration:

```js
{ tool: "wait_for_task", arguments: { taskId: "build-42", timeoutMs: "1800000" } }
```

```ts tasks.tools.ts active
import { Tool, ToolContext, z, type CallToolResult } from "@frontmcp/sdk";

// A stand-in for another agent's build: it finishes ten minutes in.
const BUILD_SECONDS = 600;

@Tool({
  name: "wait_for_task",
  description: "Wait for another agent's task to finish, for up to timeoutSec seconds",
  inputSchema: {
    taskId: z.string().describe("The task to wait for, like build-42"),
    timeoutSec: z.number().int().min(1).max(3600).default(45).describe("How long to wait, in seconds"),
  },
})
export class WaitForTask extends ToolContext {
  async execute({ taskId, timeoutSec }: { taskId: string; timeoutSec: number }): Promise<CallToolResult> {
    // Answers at once with what a real wait would have seen.
    const text =
      timeoutSec < BUILD_SECONDS
        ? `${taskId} is still running after ${timeoutSec} s.`
        : `${taskId} finished after ${BUILD_SECONDS} s.`;
    return { content: [{ type: "text", text }] };
  }
}

@Tool({
  name: "list_tasks",
  description: "List the team's tasks, optionally only those with one status",
  inputSchema: {
    filter: z.object({ status: z.enum(["running", "done"]).optional() }).optional(),
  },
})
export class ListTasks extends ToolContext {
  async execute({ filter }: { filter?: { status?: "running" | "done" } }) {
    const tasks = [
      { id: "build-42", status: "running" },
      { id: "docs-7", status: "done" },
    ];
    return { tasks: tasks.filter((task) => !filter?.status || task.status === filter.status) };
  }
}
```

```ts main.ts
import { App, FrontMcp, LogLevel, LogRecord, LogTransport, LogTransportInterface } from "@frontmcp/sdk";
import { ListTasks, WaitForTask } from "./tasks.tools";

export const warnings: string[] = [];

@LogTransport({ name: "Warnings", description: "Keeps the server's warnings for the tests" })
export class Warnings extends LogTransportInterface {
  log(record: LogRecord) {
    if (record.levelName === "warn") warnings.push(record.message);
  }
}

@App({ id: "team", name: "Agent team", tools: [WaitForTask, ListTasks] })
class TeamApp {}

@FrontMcp({
  info: { name: "agent-team", version: "1.0.0" },
  apps: [TeamApp],
  logging: { level: LogLevel.Info, transports: [Warnings] },
})
export default class Server {}
```

```ts typos.test.ts
import { test, expect } from "@frontmcp/testing";
import { warnings } from "./main";

const text = (text: string) => ({ type: "text", text });
const ignored = (keys: string) => text(`These arguments are not declared and were ignored: ${keys}.`);

test("`timeoutMs` is ignored, the wait runs for 45 s, and the answer names `timeoutSec`", async ({ mcp }) => {
  const result = await mcp.tools.call("wait_for_task", { taskId: "build-42", timeoutMs: "1800000" });
  expect(result).toBeSuccessful();
  expect(result.raw.content).toEqual([
    text("build-42 is still running after 45 s."),
    ignored("'timeoutMs' (did you mean 'timeoutSec'?)"),
  ]);
});

test("the corrected call waits the 600 s the build takes, with no extra line", async ({ mcp }) => {
  const result = await mcp.tools.call("wait_for_task", { taskId: "build-42", timeoutSec: 1800 });
  expect(result.raw.content).toEqual([text("build-42 finished after 600 s.")]);
});

test("a key in the wrong case gets the suggestion too", async ({ mcp }) => {
  const result = await mcp.tools.call("wait_for_task", { taskId: "build-42", TimeoutSec: 1800 });
  expect(result.raw.content.at(-1)).toEqual(ignored("'TimeoutSec' (did you mean 'timeoutSec'?)"));
});

test("a key far from every declared key is named without a suggestion", async ({ mcp }) => {
  const result = await mcp.tools.call("wait_for_task", { taskId: "build-42", waitMinutes: 30 });
  expect(result.raw.content).toEqual([text("build-42 is still running after 45 s."), ignored("'waitMinutes'")]);
});

test("a value over the schema's 3,600 is refused, not ignored", async ({ mcp }) => {
  const result = await mcp.tools.call("wait_for_task", { taskId: "build-42", timeoutSec: 1800000 });
  expect(result).toBeError("INVALID_INPUT");
  expect(result.text()).toContain("Too big: expected number to be <=3600");
});

test("a nested key is named by its path and gets a suggestion, and `structuredContent` is unchanged", async ({ mcp }) => {
  const result = await mcp.tools.call("list_tasks", { filter: { stauts: "running" } });
  expect(result.raw.structuredContent).toEqual({
    tasks: [
      { id: "build-42", status: "running" },
      { id: "docs-7", status: "done" },
    ],
  });
  expect(result.raw.content.at(-1)).toEqual(ignored("'filter.stauts' (did you mean 'filter.status'?)"));
});

test("the server logs each ignored key once per tool", async ({ mcp }) => {
  warnings.length = 0;
  await mcp.tools.call("wait_for_task", { taskId: "build-42", timeout: 1800 });
  await mcp.tools.call("wait_for_task", { taskId: "build-42", timeout: 1800 });
  expect(warnings).toEqual([
    "Tool \"wait_for_task\" was called with arguments its inputSchema does not declare, so they were ignored: timeout. Declare them, or set input.undeclaredKeys to 'strip' or 'fail'.",
  ]);
});
```

The **Tests** tab sends the corrected call. It uses `timeoutSec: 1800`, so the build fits within the thirty-minute wait. The whole reply is `build-42 finished after 600 s.`

The server logs each ignored key once per tool. It compares names without regard to case, so it also suggests `timeoutSec` for `TimeoutSec`. The closest name qualifies if it takes at most one edit per two characters of the longer name.

Try `waitMinutes` on the same build. Neither `taskId` nor `timeoutSec` is close enough. The wait still uses 45 seconds, and the last line is `These arguments are not declared and were ignored: 'waitMinutes'.`

*[Illustration: The no-match example, in four numbered steps between the agent, the Playground’s client, and the agent-team server, with the default policy, undeclaredKeys warn. The work happens on the server. 1: the agent sends tools/call wait_for_task with taskId build-42 and waitMinutes 30. 2: FrontMCP compares waitMinutes with the tool’s declared keys, taskId and timeoutSec; neither is close, so the warning suggests none. 3: the wait still runs its default, 45 s. 4: the reply says build-42 is still running after 45 s, and the line FrontMCP adds names the key without a suggestion: These arguments are not declared and were ignored: 'waitMinutes'.]*

**Runnable example: A warning when no argument name matches.**

**Reuses runnable project: team.**

Initial call configuration:

```js
{ tool: "wait_for_task", arguments: { taskId: "build-42", waitMinutes: 30 } }
```



<a id="refusing-calls-with-unknown-arguments"></a>

## Refusing calls with unknown arguments

An ignored timeout can mean another wait call. An ignored filter on a delete tool could mean deleting every record. Set `input.undeclaredKeys` to `"fail"` to reject unknown keys before the tool runs. The same `timeoutMs` call now gets `INVALID_INPUT` with this message.

```text
Unknown arguments: 'timeoutMs' (did you mean 'timeoutSec'?)
```

A tool's setting overrides its app's, and the app's overrides the server's. Set the policy to `"strip"` to drop unknown keys silently as in 1.12 and earlier. Each line below shows a setting on a separate class.

```ts
@FrontMcp({ info, apps: [TeamApp], input: { undeclaredKeys: "fail" } }) // every tool on the server
@App({ id: "team", name: "Agent team", tools, input: { undeclaredKeys: "fail" } }) // every tool in the app
@Tool({ name: "wait_for_task", description, inputSchema, input: { undeclaredKeys: "fail" } }) // one tool
```

Here the server sets `"fail"`. The tests record which calls reach the wait tool. The list stays empty for `timeoutMs`. Sending `timeoutSec: 1800` puts `build-42` on the list. The read-only `list_tasks` tool overrides the server with `"warn"`, so it still returns tasks when a call includes an unknown `limit`.

*[Illustration: The refusal, in three numbered steps between the agent, the Playground’s client, and the agent-team server, which sets undeclaredKeys to fail. The work happens on the server. 1: the agent sends tools/call wait_for_task with taskId build-42 and timeoutMs 1800000. 2: timeoutMs isn’t declared, so the server refuses the call at a barrier before the wait tool runs; the tool never runs, and its list of waits stays empty. 3: the agent gets back isError, INVALID_INPUT: Unknown arguments: 'timeoutMs' (did you mean 'timeoutSec'?).]*

**Runnable example: An unknown argument stops the call before the tool runs.**

Initial call configuration:

```js
{ tool: "wait_for_task", arguments: { taskId: "build-42", timeoutMs: "1800000" } }
```

```ts main.ts active
import { App, FrontMcp } from "@frontmcp/sdk";
import { ListTasks, WaitForTask } from "./tasks.tools";

@App({ id: "team", name: "Agent team", tools: [WaitForTask, ListTasks] })
class TeamApp {}

@FrontMcp({
  info: { name: "agent-team", version: "1.0.0" },
  apps: [TeamApp],
  input: { undeclaredKeys: "fail" },
})
export default class Server {}
```

```ts tasks.tools.ts
import { Tool, ToolContext, z, type CallToolResult } from "@frontmcp/sdk";

const BUILD_SECONDS = 600;

// The tasks each wait_for_task call ran for, so the tests can see which calls reached the tool.
export const waits: string[] = [];

@Tool({
  name: "wait_for_task",
  description: "Wait for another agent's task to finish, for up to timeoutSec seconds",
  inputSchema: {
    taskId: z.string().describe("The task to wait for, like build-42"),
    timeoutSec: z.number().int().min(1).max(3600).default(45).describe("How long to wait, in seconds"),
  },
})
export class WaitForTask extends ToolContext {
  async execute({ taskId, timeoutSec }: { taskId: string; timeoutSec: number }): Promise<CallToolResult> {
    waits.push(taskId);
    const text =
      timeoutSec < BUILD_SECONDS
        ? `${taskId} is still running after ${timeoutSec} s.`
        : `${taskId} finished after ${BUILD_SECONDS} s.`;
    return { content: [{ type: "text", text }] };
  }
}

@Tool({
  name: "list_tasks",
  description: "List the team's tasks, optionally only those with one status",
  inputSchema: {
    filter: z.object({ status: z.enum(["running", "done"]).optional() }).optional(),
  },
  input: { undeclaredKeys: "warn" },
})
export class ListTasks extends ToolContext {
  async execute({ filter }: { filter?: { status?: "running" | "done" } }) {
    const tasks = [
      { id: "build-42", status: "running" },
      { id: "docs-7", status: "done" },
    ];
    return { tasks: tasks.filter((task) => !filter?.status || task.status === filter.status) };
  }
}
```

```ts refuse.test.ts
import { test, expect } from "@frontmcp/testing";
import { waits } from "./tasks.tools";

test("`fail` refuses the call before the tool runs, naming `timeoutSec`", async ({ mcp }) => {
  waits.length = 0;
  const result = await mcp.tools.call("wait_for_task", { taskId: "build-42", timeoutMs: "1800000" });
  expect(result).toBeError("INVALID_INPUT");
  expect(result.text()).toBe("Unknown arguments: 'timeoutMs' (did you mean 'timeoutSec'?)");
  expect(result.raw.structuredContent).toBeUndefined();
  expect(waits).toEqual([]);
});

test("the corrected call runs", async ({ mcp }) => {
  waits.length = 0;
  const result = await mcp.tools.call("wait_for_task", { taskId: "build-42", timeoutSec: 1800 });
  expect(result.raw.content).toEqual([{ type: "text", text: "build-42 finished after 600 s." }]);
  expect(waits).toEqual(["build-42"]);
});

test("a key far from every declared key is refused without a suggestion", async ({ mcp }) => {
  const result = await mcp.tools.call("wait_for_task", { taskId: "build-42", waitMinutes: 30 });
  expect(result).toBeError("INVALID_INPUT");
  expect(result.text()).toBe("Unknown arguments: 'waitMinutes'");
});

test("a tool's own `warn` wins over the server's `fail`", async ({ mcp }) => {
  const result = await mcp.tools.call("list_tasks", { filter: { status: "done" }, limit: 5 });
  expect(result).toBeSuccessful();
  expect(result.raw.structuredContent).toEqual({ tasks: [{ id: "docs-7", status: "done" }] });
  expect(result.raw.content.at(-1).text).toBe("These arguments are not declared and were ignored: 'limit'.");
});
```

FrontMCP adds the warning to `content`. A client that forwards only `structuredContent` gives the model the task list without the warning. A refused call returns an error with no `structuredContent`.

<a id="nested-keys-since-frontmcp-1132"></a>

## Nested keys since FrontMCP 1.13.2

To find running tasks, the agent can filter the team's list by `status`. This Playground calls `list_tasks` with `{ filter: { stauts: "running" } }` on the team server from the first example. FrontMCP drops `stauts`, so the tool returns both tasks, including the finished one.

Since 1.13.2, FrontMCP looks inside `filter` for a close match and suggests its full path. The example opens on its **Wire** tab, because the **Call** tab shows only the two tasks from `structuredContent`. The reply's last text line is `These arguments are not declared and were ignored: 'filter.stauts' (did you mean 'filter.status'?).` Before 1.13.2, that line named `filter.stauts` without a suggestion. [SDK change #1486](https://github.com/agentfront/frontmcp/pull/1486)

*[Illustration: The nested-key example, in three numbered steps between the agent, the Playground’s client, and the agent-team server, with the default policy, undeclaredKeys warn. The work happens on the server. 1: the agent sends tools/call list_tasks with a filter whose key stauts, a typo for status, is set to running. 2: filter.stauts is ignored, so the filter is empty and both tasks match. 3: the structuredContent comes back with both tasks, build-42 running and docs-7 done, the finished one too, and FrontMCP adds the line These arguments are not declared and were ignored: 'filter.stauts' (did you mean 'filter.status'?).]*

**Runnable example: A misspelled nested key gets its full path suggested.**

**Reuses runnable project: team.**

Initial call configuration:

```js
{ tool: "list_tasks", arguments: { filter: { stauts: "running" } } }
```



Array items get suggestions too. When the items of a `lines` array declare `sku`, an undeclared `SKU` in one of them is named `lines[].SKU`, with the suggestion `lines[].sku`. Under `"fail"`, the refusal names the same path and suggestion: `Unknown arguments: 'filter.stauts' (did you mean 'filter.status'?)`.

<a id="where-this-can-go-next"></a>

## Where this can go next

What if the agent fixes the key but keeps the milliseconds? The wait tool caps `timeoutSec` at 3,600. Sending `timeoutSec: 1800000` on 1.13.2 gets `INVALID_INPUT`, and the error includes `Too big: expected number to be <=3600`. A subtler mistake would pass that check. Thirty seconds fits the schema even when the user asked for thirty minutes.

**Design sketch.** We're exploring a plugin that makes a decision about the values before the tool runs. It would hook the same `validateInput` stage the #1481 team used, after the keys are checked, and decide one of three things: let the call run, answer with a suggested correction, or ask a person through elicitation to approve it first. A refund fifty times the account's usual amount might warrant that question. We haven't committed to a release or an API.

CodeCall already reviews calls *in a script*. For an integer parameter, a literal `limit: "20"` gets `needs_changes` with the suggestion `limit: 20`. In the [review example](https://frontmcp.dev/reference/plugins/codecall#review-and-approvals), a destructive call gets `needs_approval`, and the run pauses for a person to approve it.

A tool can already ask the user a question during a call through [elicitation](https://frontmcp.dev/reference/sdk/elicit#asking-the-user-to-confirm). To require a person's approval before a tool runs, use the [Approval plugin](https://frontmcp.dev/reference/plugins/approval#requiring-approval-before-a-tool-runs). The [approval lesson](https://frontmcp.dev/learn/asking-for-approval#recording-an-approval) shows how to record the user's answer.

<a id="what-we-checked"></a>

## What we checked

The team that filed #1481 counted the calls on their own servers. We didn't replay those sessions. Our Playgrounds run on FrontMCP 1.13.2 in Node and in the browser. The tests check what the server returns for the typo and for the corrected call. They don't measure how often a model reads the hint and fixes its next call.

<a id="try-it"></a>

## Try it

Pick a tool whose Zod schema gives an optional field a [default value](https://frontmcp.dev/learn/schemas-are-contracts#optional-fields-and-defaults). Change the case of that key and send the call. With `"warn"`, the tool uses the default and the last text block names the ignored key. Correct the spelling and compare the two replies.

Tools that take JSON Schema input, such as those from a remote app or the OpenAPI adapter, keep extra arguments. The [input policy reference](https://frontmcp.dev/reference/sdk/tool#input-policy) covers which tools the check applies to.
