# AGENT_FORMS_INVALID

<!-- Generated by docs/modules/diagnostics from the package catalogs. Write a guide in docs/diagnostics/<CODE>.md instead of editing this file. -->

`forms()` from `vite-hub/agent/capabilities` throws `AGENT_FORMS_INVALID` when you define the Agent. The message names the form and the problem.

## Why it happens

Each form gives the Agent one tool, `ask_<name>`. `forms()` checks each entry:

- There is at least one form.
- The name is lowercase letters, digits, and underscores, such as `expense`, so `ask_<name>` is a valid tool name.
- The value is a `defineForm()` result, a Standard Schema object, or `{ form, title }`.
- A `title` is a non-empty string.

## Fix it

```diff [server/agents/expenses.ts]
 export default defineAgent({
-  capabilities: [forms({ 'Expense claim': { schema: expense } })],
+  capabilities: [forms({ expense: { form: expense, title: 'Expense claim' } })],
 })
```

## Related

- [Ask a person to fill in a form](https://vitehub.dev/docs/agents/channels#ask-a-person-to-fill-in-a-form)
- [One schema on every surface](https://vitehub.dev/docs/forms/server-api)

## Source

`AGENT_FORMS_INVALID` belongs to the `agent` package. Its catalog entry is in [`src/agent-diagnostics.ts`](https://github.com/vite-hub/vitehub/blob/main/packages/agent/src/agent-diagnostics.ts#L3514). It is raised in [`src/capabilities/forms.ts`](https://github.com/vite-hub/vitehub/blob/main/packages/agent/src/capabilities/forms.ts#L26).

See [all Agents diagnostics](https://vitehub.dev/docs/agents/diagnostics).

<!-- vitehub-docs:section-links -->
## In this section

- [Start](https://vitehub.dev/raw/docs/agents.md)
- [Define and run](https://vitehub.dev/raw/docs/agents/agent-definitions.md)
- [Instructions and tools](https://vitehub.dev/raw/docs/agents/instructions.md)
- [History and context](https://vitehub.dev/raw/docs/agents/chat-history-sessions.md)
- [Channels](https://vitehub.dev/raw/docs/agents/channels.md)
- [Inspect and evaluate](https://vitehub.dev/raw/docs/agents/observability.md)
- [Advanced](https://vitehub.dev/raw/docs/agents/agent-presets.md)
- [Capabilities](https://vitehub.dev/raw/docs/agents/capabilities/access.md)

Next: [AGENT_INVOCATION_DRIVER_INTERRUPTED](https://vitehub.dev/raw/docs/agents/diagnostics/agent_invocation_driver_interrupted.md)

All pages: [llms.txt](https://vitehub.dev/llms.txt)
