Skip to content

associate_pr

Associate an existing pull request with a Polygraph session.

Use this to link PRs that were created outside of Polygraph (e.g., manually or by CI) to the current session. Provide either a prUrl or a branch name.

NameTypeRequiredDescription
sessionIdstringyesThe Polygraph session ID, or a supported Polygraph app session URL. Supported URL paths are /s/<session-id> and /orgs/<org-id>/sessions/<session-id>. URL inputs are normalized to the session ID; the MCP always uses the current Polygraph API configuration.
prUrlstringnoURL of an existing pull request to associate with the session
branchstringnoBranch name to find and associate PRs for. Used when prUrl is not provided. In a multi-repo session, requires repo to disambiguate which repository the branch belongs to.
repostringnoRepository full name (owner/repo) or repository id identifying which session repository this PR belongs to. Required when using branch in a multi-repo session. Optional (and ignored) when prUrl is provided, since the repository is parsed from the URL.
descriptionstringyesA session description is required.
agentSessionIdstringnoThe AI agent session ID. Can be used to resume the session later. Resuming is reconnecting to restore context only. After you resume, do not make any changes until the user explicitly asks for changes.