test_connection
Verify connectivity to the NIH RePORTER API, ensuring the server can access research project and publication data.
Instructions
Test the connection to the NIH RePORTER API
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp-nih-reporter.py:492-502 (handler)The handler function for the 'test_connection' tool. It tests the connection to the NIH RePORTER API by attempting to fetch a single project using the api_client. Returns success or error message.
@mcp.tool() async def test_connection() -> str: """Test the connection to the NIH RePORTER API""" try: # Try to fetch a single project as a test result = await api_client.get_projects({"limit": 1}) return "Successfully connected to NIH RePORTER API" except Exception as e: logger.error(f"Connection test failed: {e}") return f"Connection test failed: {str(e)}"