Skip to main content
Glama

update_pull_request

Modify an existing pull request's title, description, state, base branch, or maintainer edit permission.

Instructions

Update an existing pull request in a GitHub repository.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner
repoYesRepository name
pullNumberYesPull request number to update
titleNoNew title
bodyNoNew description
stateNoNew state
baseNoNew base branch name
maintainer_can_modifyNoAllow maintainer edits

Implementation Reference

  • The function registerPullRequestTools is exported and registers all PR tools on the MCP server.
    export function registerPullRequestTools(server: McpServer, octokit: Octokit) {
  • src/index.ts:5-5 (registration)
    Import of registerPullRequestTools from the pullrequests module.
    import { registerPullRequestTools } from "./tools/pullrequests.js"
  • src/index.ts:18-18 (registration)
    Registration call to registerPullRequestTools which registers all PR tools including update_pull_request.
    registerPullRequestTools(server, octokit)
  • Full implementation of the 'update_pull_request' tool: registers the tool with schema (owner, repo, pullNumber, optional title/body/state/base/maintainer_can_modify) and handler that calls octokit.rest.pulls.update.
    // Tool: Update Pull Request
    server.tool(
    	"update_pull_request",
    	"Update an existing pull request in a GitHub repository.",
    	{
    		owner: z.string().describe("Repository owner"),
    		repo: z.string().describe("Repository name"),
    		pullNumber: z.number().describe("Pull request number to update"),
    		title: z.string().optional().describe("New title"),
    		body: z.string().optional().describe("New description"),
    		state: z.enum(["open", "closed"]).optional().describe("New state"),
    		base: z.string().optional().describe("New base branch name"),
    		maintainer_can_modify: z
    			.boolean()
    			.optional()
    			.describe("Allow maintainer edits"),
    	},
    	async ({
    		owner,
    		repo,
    		pullNumber,
    		title,
    		body,
    		state,
    		base,
    		maintainer_can_modify,
    	}) => {
    		try {
    			const response = await octokit.rest.pulls.update({
    				owner,
    				repo,
    				pull_number: pullNumber,
    				title,
    				body,
    				state,
    				base,
    				maintainer_can_modify,
    			})
    			const pr = response.data
    			return {
    				content: [{ type: "text", text: `PR updated: **#${pr.number}: ${pr.title}**\nState: ${pr.state}\nURL: ${pr.html_url}\nUpdated: ${pr.updated_at}` }],
    			}
    		} catch (e: any) {
    			return {
    				content: [{ type: "text", text: `Error: ${e.message}` }],
    			}
    		}
    	},
    )
  • Input schema for update_pull_request using Zod: owner (string), repo (string), pullNumber (number), title (optional string), body (optional string), state (optional enum open/closed), base (optional string), maintainer_can_modify (optional boolean).
    {
    	owner: z.string().describe("Repository owner"),
    	repo: z.string().describe("Repository name"),
    	pullNumber: z.number().describe("Pull request number to update"),
    	title: z.string().optional().describe("New title"),
    	body: z.string().optional().describe("New description"),
    	state: z.enum(["open", "closed"]).optional().describe("New state"),
    	base: z.string().optional().describe("New base branch name"),
    	maintainer_can_modify: z
    		.boolean()
    		.optional()
    		.describe("Allow maintainer edits"),
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits. It only says 'Update', missing details on required permissions, side effects (e.g., closing a PR may auto-close issues), or that the PR must exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with clear front-loading of the primary action. No redundant words, though it omits important details that could be included concisely.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lacking annotations and output schema, the description offers no information about return values, side effects, prerequisites, or error conditions. It is insufficient for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides full descriptions for all parameters (100% coverage). The description adds no additional meaning beyond the schema, falling short of compensating for ambiguity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'update', resource 'pull request', and scope 'existing', distinguishing it from siblings like create_pull_request and merge_pull_request.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs alternatives such as update_pull_request_branch for branch changes or merge_pull_request for merging. No explicit contexts or exclusions are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hithereiamaliff/mcp-github'

If you have feedback or need assistance with the MCP directory API, please join our Discord server