/
pickling
/
mcp-sourcecontrol-python
Обзор
Документация
Войти
/
pickling
/
mcp-sourcecontrol-python
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/mcp_sourcecontrol/tools/update_pull_request.py
39 строк
1 KB
pickling-21
Python-порт mcp-sourcecontrol: 20 инструментов, stdio и Streamable HTTP
29 июл 2026, 02:18
29 июл 2026, 02:18
bc8bde4
Код
Авторство
О чём код?
"""MCP-инструмент git_update_pull_request.""" from typing import Annotated from pydantic import Field from ..runtime import current_client from .annotations import WRITE from .define import ToolDefinition from .formatting import to_json from .schemas import ParamProjectKey, ParamRepositorySlug async def _handler( project: ParamProjectKey, repository: ParamRepositorySlug, pullRequestIndex: Annotated[int, Field(description="PR index to update")], title: Annotated[str | None, Field(description="New title. Omit to keep current.")] = None, body: Annotated[str | None, Field(description="New description/body. Omit to keep current.")] = None, targetBranch: Annotated[str | None, Field(description="New target branch. Omit to keep current.")] = None, ) -> str: result = await current_client().update_pull_request( project, repository, pullRequestIndex, title=title, body=body, target_branch=targetBranch, ) return to_json(result) TOOL = ToolDefinition( name="git_update_pull_request", group="write", description="Update an existing pull request in the repository. Note: Cannot update a merged or closed PR.", annotations=WRITE, handler=_handler, )