Home / Directory / Apollo GraphOS / PublishContract

PublishContract

An MCP tool from the Apollo GraphOS server, run by Apollo.

Create or update a contract variant and start a launch for it, the same write that `rover contract publish` performs. A contract variant is a filtered view of another variant's schema, built by including and excluding schema elements by tag. The filter configuration replaces the previous one in full, so send the complete include and exclude lists rather than only the tags you want to change. The same applies to hideUnreachableTypes, which has no default: when you update a contract, pass the value it has now. GetContractConfig states that value in its description. Returns the contract variant and a link to the launch, or the error messages that stopped it. Provide the graph ID, the contract variant name, the source variant, the include and exclude tag lists, and whether to hide unreachable types.

Name on the gateway: apollo_graphos__PublishContract.

Parameters

NameTypeDescription
graphId requiredstring
contractVariant requiredstringThe name of the contract variant, e.g. `public-api`. Once set, this value cannot be changed.
sourceVariantmixedThe graphRef of the variant the contract will be derived from, e.g. `my-graph@production`. Once set, this value cannot be changed.
include requiredarray
exclude requiredarray
hideUnreachableTypes requiredboolean
initiateLaunchmixedWhether a launch and schema publish should be initiated after updating configuration. Defaults to `true`.

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "apollo_graphos__PublishContract",
  "arguments": {
    "graphId": "…",
    "contractVariant": "…",
    "include": [],
    "exclude": [],
    "hideUnreachableTypes": true
  }
}

The first call connects Apollo GraphOS to your account automatically; nothing to set up. About this server.

Try asking

Use the publishcontract tool with graphId set to ….

More from Apollo GraphOS