/
pickling
/
mcp-sourcecontrol-python
Обзор
Документация
Войти
/
pickling
/
mcp-sourcecontrol-python
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/mcp_sourcecontrol/tools/add_pull_request_comment.py
41 строка
1 KB
pickling-21
Python-порт mcp-sourcecontrol: 20 инструментов, stdio и Streamable HTTP
29 июл 2026, 02:18
29 июл 2026, 02:18
bc8bde4
Код
Авторство
О чём код?
"""MCP-инструмент git_add_pull_request_comment.""" from typing import Annotated, Literal 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")], body: Annotated[str, Field(min_length=1, description="Comment text. Supports Markdown.")], filePath: Annotated[ str | None, Field(description="File path for inline comment. Creates a file-level comment when specified."), ] = None, line: Annotated[int | None, Field(description="Line number in the diff. Requires filePath.")] = None, lineType: Annotated[ Literal["ADDED", "REMOVED", "CONTEXT"] | None, Field(description="Type of the diff line. Required when line is specified."), ] = None, ) -> str: result = await current_client().add_pull_request_comment( project, repository, pullRequestIndex, body, filePath, line, lineType ) return to_json(result) TOOL = ToolDefinition( name="git_add_pull_request_comment", group="write", description="Add a comment to a pull request.", annotations=WRITE, handler=_handler, )