configure_token
Set the Barista authentication token to enable API access for Gene Ontology Causal Activity Model operations.
Instructions
Configure the Barista authentication token.
Args: token: The Barista authentication token
Returns: Success status
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/noctua_mcp/mcp_server.py:64-87 (handler)The main implementation of the configure_token tool. It is decorated with @mcp.tool(), takes a token parameter, sets the BARISTA_TOKEN environment variable, resets the global _client to None (so the next call to get_client() creates a new BaristaClient with the new token), and returns a success response.
@mcp.tool() async def configure_token(token: str) -> Dict[str, Any]: """ Configure the Barista authentication token. Args: token: The Barista authentication token Returns: Success status """ import os global _client # Set environment variable os.environ["BARISTA_TOKEN"] = token # Reset client to pick up new token _client = None return { "success": True, "configured": True } - src/noctua_mcp/mcp_server.py:64-64 (registration)The tool is registered via the @mcp.tool() decorator on line 64 of mcp_server.py. FastMCP automatically registers the function as an MCP tool named 'configure_token'.
@mcp.tool() - src/noctua_mcp/mcp_server.py:56-61 (helper)The get_client() helper is used by other tools to obtain a BaristaClient. The _client global variable is reset to None by configure_token, forcing get_client() to create a new client with the updated token.
def get_client() -> BaristaClient: """Get or create the Barista client instance.""" global _client if _client is None: _client = BaristaClient() return _client