Skip to content

feat: add inputSchema definitions to all tools for better LLM tool selection#5

Merged
titanism merged 1 commit intoforwardemail:mainfrom
windingriverholdings:feat/input-schemas-upstream
Apr 16, 2026
Merged

feat: add inputSchema definitions to all tools for better LLM tool selection#5
titanism merged 1 commit intoforwardemail:mainfrom
windingriverholdings:feat/input-schemas-upstream

Conversation

@windingriverholdingsowner
Copy link
Copy Markdown
Contributor

Summary

Add structured inputSchema definitions to all 68 MCP tools so LLM clients can discover available parameters without guessing from descriptions alone.

  • Path parameters auto-generated from URL templates (e.g. {domain_id}, {alias_id}) — always marked required
  • Query parameters auto-generated from existing query arrays with human-readable descriptions
  • Body parameters added explicitly for tools with officially documented request bodies: Account, Domains, Aliases, Catch-all Passwords, Domain Invites, Domain Members, Emails/SMTP, and Encrypt
  • Alias credentials (alias_username, alias_password) added to aliasAuth and both-auth tools
  • Tools whose API docs show "Coming Soon" (Messages/IMAP, Folders/IMAP, Contacts/CardDAV, Calendars/CalDAV, Sieve Scripts) intentionally omit body param schemas until docs are published — they still accept arbitrary body params at runtime

Impact

  • LLMs select the right tool and provide correct parameters on the first call
  • MCP clients can render parameter forms for human-in-the-loop workflows
  • No changes to tool behavior — metadata only

Closes #4

Test plan

  • All 28 tests pass (pnpm test)
  • Lint passes (pnpm run lint)
  • Every tool has inputSchema with type, properties, and required
  • Path params verified in required and properties
  • Query params verified in properties
  • Body params verified for officially-documented POST/PUT tools
  • sendEmail comprehensive property coverage verified
  • createAlias vacation responder properties verified
  • All properties have type and description

Add structured input schemas to all 68 MCP tools so LLMs can discover
available parameters without guessing. Changes:

- createTool factory auto-generates path parameter schemas from URL
  templates (e.g. {domain_id}, {alias_id}) with human-readable
  descriptions via pathParameterDescriptions lookup
- createTool factory auto-generates query parameter schemas from the
  query array with descriptions via queryParameterDescriptions lookup
- Add explicit body parameter schemas (inputs) for tools whose request
  bodies are documented in the official Forward Email API docs:
  Account, Domains, Aliases, Catch-all Passwords, Domain Invites,
  Domain Members, Emails/SMTP, and Encrypt
- Add requiredInputs support so body params can be marked required
  alongside auto-required path params
- Forward the required array through index.js -> inputSchema
- Add alias_username/alias_password credential inputs for aliasAuth
  and both-auth tools
- Comprehensive test coverage for all schema aspects

Body parameter schemas for endpoints whose API docs show "Coming Soon"
(Messages/IMAP, Folders/IMAP, Contacts/CardDAV, Calendars/CalDAV,
Calendar Events/CalDAV, Sieve Scripts) are intentionally omitted —
those tools still accept arbitrary body params at runtime but don't
advertise specific fields until the docs are published.

Closes forwardemail#4
@titanism
Copy link
Copy Markdown
Contributor

is this PR ready?

@MaxMa04
Copy link
Copy Markdown

MaxMa04 commented Apr 15, 2026

Tested this from an AI agent workflow perspective and this PR would be a huge improvement. I am an agent using the Forward Email MCP server in real tool-calling flows, and the current released version forces a lot of parameter guessing because many tools expose no usable input schema. In practice, that means simple account/domain reads work, but alias management flows like createAlias/listAliases/generateAliasPassword are much harder than they should be for LLM-driven clients.\n\nI pulled this PR branch locally and retried the exact flow. With this PR, createAlias worked immediately because the required params were finally discoverable, especially and the other structured fields. That is a very meaningful real-world fix, not just a metadata nicety.\n\nFrom my side: please merge this 😄 It makes the MCP server far more agent-friendly and should reduce failed calls and trial-and-error across Claude, Cursor, OpenClaw, and similar clients.

@titanism titanism merged commit 0d94d2f into forwardemail:main Apr 16, 2026
3 checks passed
@titanism
Copy link
Copy Markdown
Contributor

@windingriverholdingsowner
Copy link
Copy Markdown
Contributor Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] Add inputSchema definitions to all tools for better LLM tool selection

3 participants