@fortrip/agent-contract
The contract of Fortrip API v1 (https://api.fortrip.ai/v1) and its MCP
server (https://mcp.fortrip.ai/): the limits, paths, request and response
schemas, error codes and field rules that the Fortrip CLI (fortrip), the
hosted MCP server and the store listings all share, so they cannot drift
apart.
It has one peer dependency, zod (^4.4.0), and runs anywhere
ES2023 does. Its major version changes when the contract breaks, not with
the API: 6.x serves Fortrip API v1.
import { API, LIMITS, PUBLIC_ORIGINS, containsCardNumber } from "@fortrip/agent-contract";
PUBLIC_ORIGINS.api + API.hotelSearch; // "https://api.fortrip.ai/v1/hotels/search"
LIMITS.rooms; // 8
It exports:
API,PUBLIC_ORIGINS,MCP_PATH,LIMITS,ERROR_CODES,SEARCH_SORTSandFILTERABLE_AMENITIES: paths, hosts, limits, error codes and vocabularies;searchHotelsInput,getHotelInput,hotelOffersInput,createOrderInput,getOrderInput,listOrdersInput,cancelOrderInputandpayOrderInput, the zod schemas of the requests, withoffersPerHotel(limitPerHotel, hotelsWithOffers), the offers each hotel of an offers call gets, andmisplacedKeys(schema, issues, sent), where a key sent at the wrong depth belongs, withmisplacedKeyHint(key), what to tell the caller about it, andsearchResult,hotel,hotelOffersResult,order,orderList,paymentHandleranderrorEnvelope, the open schemas of the responses, withERROR_DETAILS, each error code'sdetails, andparseOpen, a parser that keeps unknown fields and values;COMMANDS,COMMAND_GROUPSandGLOBAL_FLAGS, the CLI's commands, the groups they are typed after and its flags,commandInvocation(spec), a command as it is typed (fortrip hotels search),TOOLS, the MCP tools, andSERVER_INFO, what an MCP server for Fortrip says of itself;renderToolResult(tool, data, surface?)andrenderError(envelope, status?, surface?), the whole text of a result or an error, naming tools ("mcp", the default) or commands and flags ("cli"): an MCP result is this one text block, with nothing added. The rules a result ends with are exported too (ORDER_NEXT_STEP,CANCEL_NEXT_STEP,PAY_NEXT_STEP,PRESENTATION_HINT, andcancelNextStep(surface)andpayNextStep(surface), which word two of them for"mcp"or"cli"), andrenderGuide(surface, topic), the agent guide as Markdown for"mcp","claude-skill"or"cli";- field rules such as
containsCardNumber, the guest-name rule and the date helpers, andCONTRACT_VERSION.
Browser code that only needs the guest-name rule (GUEST_NAME_PATTERN,
GUEST_NAME_TITLE, GUEST_NAME_MESSAGE, guestNameRe, normalizeGuestName)
can import it from @fortrip/agent-contract/guest-name. That module imports
no package, so it does not pull in zod or the schemas the root entry builds
at load. The root entry exports the same names.
Apache License 2.0 (versions before 2.0.0: MIT). Copyright 2026 FortripAI, Inc. "Fortrip" is a trademark of FortripAI, Inc. The license does not grant permission to use the trade names, trademarks, service marks or product names of FortripAI, Inc., except as required for reasonable and customary use in describing the origin of the software and reproducing the content of the NOTICE file (section 6). Source: https://github.com/FortripEngineering/fortrip/tree/main/packages/contract.