New capabilities should use one implementation with protocol-specific adapters.
- Define the capability behavior and output shape.
- Add shared code when both Apps and Actions need the behavior.
- Add an MCP tool adapter under
mcp/tools/. - Add an MCP UI widget under
mcp/widgets/when the capability renders an inline ChatGPT component. - Register the MCP tool in
mcp/tool-registry.ts. - Register the MCP UI widget in
mcp/widgets/index.tswhen a component is added. - Add an Actions endpoint under
actions/when GPT Actions needs the behavior. - Add the OpenAPI operation contract in
actions/action-contract.ts. - Run
npm run sync:actions-routeswhen an Actions route literal changed. - Add live tests for each exposed surface.
- Run targeted tests for the changed surface.
- Run
npm run checkbefore final release.
Use Request Lifecycle before changing a path that crosses OAuth, MCP, Actions, or shared capability code.
Each MCP tool defines:
nametitledescriptioninputSchemaoutputSchemaannotationsinvocationrequiredScopesrun
Tool output must pass the advertised output schema. Protected tools must verify an MCP-audience token and required scopes before returning protected data.
Use MCP Tool Development for descriptor, registration, and test details.
Use MCP Apps UI Resources when the tool returns a ChatGPT-rendered component.
Each Actions endpoint defines:
- Method and path.
- Header and query input.
- Token audience validation.
- Required scopes.
- Response type.
- OpenAPI operation metadata.
Actions endpoints reject access_token query parameters and validate bearer tokens against the Actions audience.
Use Actions Endpoint Development for route, bearer, OpenAPI, and test details.
Shared request and response shapes should be updated across the domain type, MCP output schema, Actions OpenAPI schema, API docs, and live tests in the same feature slice.
Use Shared Types And Schemas before changing a data shape used by multiple surfaces.
Tests belong under test/. Service tests should exercise live HTTP behavior where protocol behavior matters. Documentation wording and style are reviewed manually through rereading.