/
pickling
/
mcp-sourcecontrol-python
Обзор
Документация
Войти
/
pickling
/
mcp-sourcecontrol-python
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/mcp_sourcecontrol/tools/delete_branch.py
29 строк
854 B
pickling-21
Python-порт mcp-sourcecontrol: 20 инструментов, stdio и Streamable HTTP
29 июл 2026, 02:18
29 июл 2026, 02:18
bc8bde4
Код
Авторство
О чём код?
"""MCP-инструмент git_delete_branch.""" from typing import Annotated from pydantic import Field from ..runtime import current_client from .annotations import DESTRUCTIVE from .define import ToolDefinition from .formatting import to_json from .schemas import ParamProjectKey, ParamRepositorySlug async def _handler( project: ParamProjectKey, repository: ParamRepositorySlug, branchName: Annotated[str, Field(min_length=1, description="Name of the branch to delete")], ) -> str: await current_client().delete_branch(project, repository, branchName) return to_json({"deleted": True, "branchName": branchName}) TOOL = ToolDefinition( name="git_delete_branch", group="write", description="Delete a branch from the repository. This action is irreversible.", annotations=DESTRUCTIVE, handler=_handler, )