A Next.js application for AI-powered maritime shipping risk decomposition and parametric insurance analysis. Extracts shipment data from documents, decomposes risks across multiple dimensions (weather, price, policy, macro), and maps them to live Polymarket prediction markets.
Two tools with clear names and reasonable descriptions, but critical gaps in schema completeness and parameter documentation. search_polymarket has a basic input schema (query string) but lacks output schema documentation. submit_decomposition references DecomposeSchema (Zod-based) but the actual schema structure is not visible in the provided code, only the import is shown. Both tools lack explicit parameter constraints (enums, ranges, formats). Error handling is present but generic (Anthropic APIError catch-all). No tool annotations (readOnlyHint/destructiveHint) despite clear risk profiles (READ_ONLY vs WRITE). Descriptions are adequate (100-150 chars) but could be more LLM-optimized with dependency hints and recovery guidance.
Search Polymarket Gamma API for active prediction market events. Returns up to 5 matches with current YES / NO prices, 24h volume, liquidity, and end date. Use this to find real, tradeable markets — never invent slugs.
Submit the final factor decomposition. Call this EXACTLY ONCE after you've gathered all the markets you need. Provide between 3 and 6 factors covering as many of the four categories as possible (weather/price/policy/macro).
Output schemas not documented. search_polymarket returns JSON.stringify(hits) but the structure of 'hits' is not visible in the provided code. submit_decomposition references DecomposeSchema but the actual schema definition is not shown, only the import statement. LLMs cannot plan downstream calls without knowing what fields to expect.
Missing tool annotations. search_polymarket is marked Risk: READ_ONLY and submit_decomposition is marked Risk: WRITE, but the tool definitions do not include readOnlyHint or destructiveHint annotations. This prevents agents from reasoning about idempotency and retry safety.
Parameter 'query' in search_polymarket lacks constraints. Description provides examples ('hurricane US May', 'WTI April') but no length limits, character restrictions, or language requirements are formally specified. LLMs may pass invalid or excessively long queries.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 53 | 2026-07-28+ | v2 |
Error messages are generic. Anthropic APIError is caught and returned as 'Anthropic {status}: {message}', but no recovery guidance is provided. If a search fails, the LLM does not know whether to retry, adjust the query, or escalate.
submit_decomposition input schema (DecomposeSchema) is not visible in the provided code snippet. Only the Zod import is shown. Cannot verify that 'factors' array has proper type definitions, min/max length constraints, or field descriptions for polymarketSlug, polymarketSide, rationaleZh, severity, and category.