Skip to main content
Glama

start_project

Initialize a Python project with ty type checking to enable semantic code analysis, structural navigation, and accurate editing tools.

Instructions

Initialize ty for a Python project. Must be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes

Implementation Reference

  • The implementation of the 'start_project' MCP tool, which initializes the TyLspClient and starts the analysis for a given project path.
    async def start_project(project_path: str) -> str:
        """Initialize ty for a Python project. Must be called first."""
        global _lsp_client
    
        path = Path(project_path).resolve()
        if not path.exists():
            return _error(f"Path not found: {project_path}")
        if not path.is_dir():
            return _error(f"Not a directory: {project_path}")
    
        if _lsp_client is not None:
            try:
                await _lsp_client.stop()
            except Exception:
                pass
    
        try:
            _lsp_client = TyLspClient()
            await _lsp_client.start(path)
            return _ok({"path": str(path), "initialized": True})
        except Exception as e:
            _lsp_client = None
            logger.exception("Failed to start ty server")
            return _error(str(e))

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/qinsehm1128/mcp-ty'

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