Validation methods
MAPI is designed to be validated easily—by humans, LLMs, or automated tools:
- Manual review — Use the checklist below against your document
- LLM validation — Give an LLM the validator reference card and your spec
- Automated tools — Coming soon (community contributions welcome)
LLM-assisted validation
The validator reference card teaches an LLM exactly what to check. It will catch structural issues, invalid transport strings, missing required sections, and more.
MAPI Validator Reference Card
Raw markdown for LLM consumption — validation rules and error patterns
Or paste this prompt directly into your LLM chat
# Instructions Validate the following MAPI document against the rules in the validator reference card. Report any issues found, organized by: 1. Document-level issues (missing title, metadata, etc.) 2. Capability-level issues (per capability) 3. TypeScript syntax issues (in code blocks) For each issue, explain what's wrong and how to fix it. # MAPI Validator Reference Card [Paste MAPI-VALIDATOR.md here] # MAPI Document to Validate [Paste your .mapi.md file here]
Quick checklist
Run through this manually for a quick sanity check:
Validation Checklist
Document Level
.mapi.md extension
# Title (H1 heading)
~~~meta block with version, base_url, auth
## Capability: section
Per Capability
~~~meta block with id and transport
HTTP METHOD /path or WS /path
### Intention with non-empty prose
### Input if method expects body (POST/PUT/PATCH)
~~~response 200 or ### Output
Common issues
These come up frequently, especially with LLM-generated specs:
- Missing
HTTPprefix — Transport should beHTTP POST /path, not justPOST /path - Weak Intentions — "Creates a user" doesn't help; explain when and why
- Constraints in wrong place —
field: string requiredisn't valid TypeScript; usefield: string; // required - Response without status — Use
~~~response 200, not just~~~response - Over-documenting errors — Standard errors (400, 401, 500) should use
> Errors: standard (...)
After validation, ask the LLM to "fix all the issues you found and output the corrected MAPI document." It's usually faster than fixing manually.