Skip to main content
Glama

get_project

Retrieve detailed information about a cryptocurrency or blockchain project by its ID using RootData MCP Server. Include optional team and investor data for comprehensive insights.

Instructions

Obtain project details according to the project ID.

Args: project_id: The unique identifier for the project. include_team: Whether to include team member information, default is false. include_investors: Whether to include investor information, default is false.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_investorsNo
include_teamNo
project_idYes

Implementation Reference

  • The main handler function for the 'get_project' MCP tool. It is decorated with @mcp.tool(), defines the input schema via type hints and docstring, registers the tool, and implements the logic to fetch project details from the RootData API using the make_request helper, handling errors and formatting the JSON response.
    @mcp.tool() async def get_project( project_id: int, include_team: bool = False, include_investors: bool = False, ) -> str: """Obtain project details according to the project ID. Args: project_id: The unique identifier for the project. include_team: Whether to include team member information, default is false. include_investors: Whether to include investor information, default is false. """ # Prepare request data data = { "project_id": project_id, "include_team": include_team, "include_investors": include_investors, } # Fetch data from the API response = await make_request("get_item", data) # Check if there was an error if "Error" in response: return f"Error: {response['Error']}" # Check if data is found if response.get("result") != 200 or not response.get("data"): return f"No project found with ID {project_id}." # Return the formatted results return json.dumps(response["data"], indent=2)
  • Supporting helper function used by the get_project tool (and others) to make asynchronous HTTP requests to the RootData API, handling authentication via environment variable and error cases.
    async def make_request(endpoint: str, data: dict) -> dict[str, any] | None: """Make a request to the RootData API with proper error handling.""" headers = { "Content-Type": "application/json", "language": "en", } if api_key := os.environ.get("ROOTDATA_API_KEY"): headers["apikey"] = api_key else: return {"Error": "ROOTDATA_API_KEY environment variable is not set"} url = f"{ROOTDATA_API_BASE}/{endpoint}" async with httpx.AsyncClient() as client: try: response = await client.post(url, headers=headers, json=data, timeout=30.0) response.raise_for_status() return response.json() except Exception as e: return {"Error": str(e)}

Other Tools

Related 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/jincai/rootdata-mcp-server'

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