get_assets
Retrieve asset holdings for a given crypto address using the BICScan MCP Server. Input an EOA, CA, ENS, CNS, or KNS to receive a detailed list of associated assets.
Instructions
Get Assets holdings by CryptoAddress
Args:
address: EOA, CA, ENS, CNS, KNS.
Returns:
Dict: where assets is a list of assets
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes |
Implementation Reference
- src/bicscan_mcp/server.py:88-107 (handler)The handler function for the 'get_assets' MCP tool. Decorated with @mcp.tool() for registration. It logs the request, sets up the API endpoint and data payload with assets=True, calls the post_request helper to query the BICScan API, and returns the response.@mcp.tool() async def get_assets(address: str) -> dict: """Get Assets holdings by CryptoAddress Args: address: EOA, CA, ENS, CNS, KNS. Returns: Dict: where assets is a list of assets """ logger.info(f"Getting assets for address: {address}") endpoint = "/v1/scan" data = { "query": address, "sync": True, "assets": True, "engines": ["ofac"], } return await post_request(endpoint, data=data)
- src/bicscan_mcp/server.py:40-64 (helper)Helper function used by get_assets (and get_risk_score) to make authenticated POST requests to the BICScan API, handling errors and logging.async def post_request( endpoint: str, data: dict[str, Any] | None = None ) -> dict[str, Any] | None: """Make a request to BICScan API with proper error handling.""" headers = { "User-Agent": "bicscan-mcp/1.0", "Accept": "application/json", "X-Api-Key": BICSCAN_API_KEY, } url = urljoin(BICSCAN_API_BASE, endpoint) async with httpx.AsyncClient() as client: try: logger.info(f"Making request to {url}") logger.debug(f"{headers=} {data=}") response = await client.post(url, headers=headers, json=data, timeout=30) response.raise_for_status() logger.info(f"Received response: {response.status_code}") return response.json() except httpx.HTTPStatusError as http_err: logger.error(f"Received response: {http_err}, {response.text}") return response.json() except Exception as e: logger.exception(f"Received response: {e}, {response.text}") return {}
- src/bicscan_mcp/server.py:89-96 (schema)Type hints and docstring defining the input (address: str) and output (dict) schema for the get_assets tool.async def get_assets(address: str) -> dict: """Get Assets holdings by CryptoAddress Args: address: EOA, CA, ENS, CNS, KNS. Returns: Dict: where assets is a list of assets """