### Bash Git Commit Examples Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Illustrates the practical application of the defined Git commit message format for various types of changes, such as new features, bug fixes, and documentation updates. These examples serve as a guide for contributors to follow the project's commit conventions. ```bash git commit -m "feat(tools): add transaction lookup pagination support" git commit -m "fix(auth): handle missing API key gracefully" git commit -m "docs(README): clarify AI routing optional feature" ``` -------------------------------- ### Unit Testing with Pytest Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Demonstrates how to run unit tests using Pytest, including installing missing dependencies like `psutil`, running all tests, generating coverage reports, and executing specific test files or cases. Useful for verifying code functionality. ```bash # Install missing test dependencies (temporary workaround) pip install psutil # Run all tests pytest # Run with coverage pytest --cov=src/revenium_mcp_server --cov-report=html # Run specific test file pytest tests/test_auth.py # Run with verbose output pytest -v # Run specific test pytest tests/test_auth.py::test_auth_config_validation ``` -------------------------------- ### Install and Configure Revenium MCP Server Source: https://context7.com/revenium/revenium-mcp/llms.txt Instructions for installing the Revenium MCP server using the 'uv' package manager and configuring it for different AI assistants like Claude, Cursor, and Augment. It covers both Starter and Business profiles, as well as local development setup. ```bash # Install uv package manager pip install uv # For Claude Code - Starter profile (recommended) claude mcp add revenium \ -e REVENIUM_API_KEY=hak_your_api_key_here \ -- uvx revenium-mcp # For Claude Code - Business profile (full features) claude mcp add revenium \ -e REVENIUM_API_KEY=hak_your_api_key_here \ -e TOOL_PROFILE=business \ -- uvx revenium-mcp # For local development/testing cat > .env << EOF REVENIUM_API_KEY=hak_your_api_key_here TOOL_PROFILE=starter EOF uvx revenium-mcp # For Cursor/Augment IDE - add to mcp.json { "mcpServers": { "revenium": { "command": "uvx", "args": ["revenium-mcp"], "env": { "REVENIUM_API_KEY": "hak_your_api_key_here", "TOOL_PROFILE": "business" } } } } ``` -------------------------------- ### Install and Run MCP Server with uvx Source: https://github.com/revenium/revenium-mcp/blob/main/README.md This snippet demonstrates the recommended method for local testing using uvx. It involves installing uv, creating a .env file with necessary credentials, and then running the MCP server using uvx, which automatically loads the .env file. ```bash # Install uv if you don't have it pip install uv # Create .env file cat > .env << EOF REVENIUM_API_KEY=hak_your_api_key_here TOOL_PROFILE=starter EOF # Run the server (automatically loads .env) uvx revenium-mcp ``` -------------------------------- ### Initialize Local Development Environment Source: https://github.com/revenium/revenium-mcp/blob/main/README.md Steps to clone the repository, set up a virtual environment, install dependencies, and configure the .env file for local development. ```bash git clone https://github.com/revenium/revenium-mcp.git cd revenium-mcp python -m venv venv source venv/bin/activate pip install -e ".[dev]" cat > .env << EOF REVENIUM_API_KEY=hak_your_api_key_here REVENIUM_TEAM_ID=your_team_id LOG_LEVEL=DEBUG EOF ``` -------------------------------- ### Manual Testing with MCP Clients and Direct Execution Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Provides commands for manual testing using MCP clients like Claude Code or direct server execution. Includes adding Revenium MCP to Claude settings and starting the server manually. Shows expected output and known startup warnings. ```bash # Add to MCP settings claude mcp add revenium-dev \ -e REVENIUM_API_KEY=your_key \ -e REVENIUM_TEAM_ID=your_team \ -e REVENIUM_BASE_URL=https://api.revenium.ai \ -- /path/to/revenium-mcp/venv/bin/python -m revenium_mcp_server ``` ```bash # Start server manually python -m revenium_mcp_server ``` -------------------------------- ### Clone and Setup Python Virtual Environment Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Clones the Revenium MCP repository and sets up a Python virtual environment for development. Installs the package in editable mode with development dependencies. Requires Git and Python 3.11+. ```bash # Clone your fork git clone https://github.com/YOUR_USERNAME/revenium-mcp.git cd revenium-mcp # Create and activate virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install package in editable mode with development dependencies pip install -e ".[dev]" ``` -------------------------------- ### Python Example Usage of Revenium MCP Constants Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Demonstrates how to import and utilize configuration constants from the `constants.py` module within the Revenium MCP server. This includes initializing an API client with a base URL and API version, and reporting server capabilities including rate limits. ```python from revenium_mcp_server.constants import ( DEFAULT_BASE_URL, API_SUPPORTED_VERSIONS, API_RATE_LIMIT_PER_MINUTE, MCP_SERVER_VERSION ) import os # Use in API client initialization client = ReveniumClient( base_url=os.getenv("REVENIUM_BASE_URL", DEFAULT_BASE_URL), api_version=API_SUPPORTED_VERSIONS[0] ) # Use in capability reporting capabilities = { "server_version": MCP_SERVER_VERSION, "rate_limits": { "requests_per_minute": API_RATE_LIMIT_PER_MINUTE } } ``` -------------------------------- ### Python Example for Adding New MCP Tools Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Provides a template for creating new tool handlers within the Revenium MCP project. It showcases the expected function signature, including type annotations for arguments and return types, facilitating the integration of new functionalities. ```python from mcp.types import TextContent async def new_tool_handler(action: str, **kwargs) -> list[TextContent]: """Handle new tool operations. Args: action: The action to perform **kwargs: Additional parameters Returns: List of TextContent responses """ # Implementation pass ``` -------------------------------- ### Install MCP Server in Virtual Environment Source: https://github.com/revenium/revenium-mcp/blob/main/README.md This option provides instructions for installing the revenium-mcp package within a Python virtual environment. It includes creating and activating the environment, installing the package via pip, setting up the .env file, and running the server using the Python module. ```bash # Create and activate virtual environment python -m venv revenium-mcp-env source revenium-mcp-env/bin/activate # On Windows: revenium-mcp-env\Scripts\activate # Install package pip install revenium-mcp # Create .env file for configuration cat > .env << EOF REVENIUM_API_KEY=hak_your_api_key_here TOOL_PROFILE=starter EOF # Run the server (automatically loads .env from current directory) python -m revenium_mcp_server ``` -------------------------------- ### Release and Publish Package Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Commands to build the distribution, verify package integrity, and upload the release to PyPI. ```bash # Build distribution python -m build # Check package twine check dist/* # Upload to PyPI (maintainers only) twine upload dist/* ``` -------------------------------- ### Troubleshoot Dependency Issues Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Commands to resolve common Python module errors by reinstalling the package in editable mode or installing missing dependencies. ```bash # Reinstall in editable mode pip install -e . # Install missing dependency (temporary workaround) pip install psutil ``` -------------------------------- ### Enable and Test AI Routing Feature Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Guides on enabling the optional AI routing feature by adding relevant variables to the `.env` file and running the server. Verifies functionality by checking OpenAI usage in the Revenium dashboard. Requires an OpenAI API key. ```bash # Add to your .env file: cat >> .env << EOF AI_ROUTING_ENABLED=true OPENAI_API_KEY=sk-... EOF # Run server and verify self-metering python -m revenium_mcp_server # Check that OpenAI usage appears in Revenium dashboard ``` -------------------------------- ### Format Code with Black and Isort Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Shows how to use `black` for code formatting and `isort` for sorting imports to maintain Python style consistency. Includes commands for applying formatting, checking without changes, and formatting new code before committing. ```bash # Format code with black (applies formatting) black src/ tests/ # Check formatting without making changes black --check src/ tests/ # Sort imports isort src/ tests/ ``` -------------------------------- ### Validate MCP Environment Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Checks the installed version of the FastMCP framework to ensure compliance with protocol requirements. ```bash # Verify FastMCP version pip show fastmcp ``` -------------------------------- ### Manage Alerts and Capabilities Source: https://context7.com/revenium/revenium-mcp/llms.txt Functions to retrieve alert capabilities and view examples for specific alert types like budget thresholds or spike detection. ```python manage_alerts(action="get_capabilities") manage_alerts(action="get_examples", alert_type="budget_threshold") manage_alerts(action="get_examples", alert_type="spike_detection") ``` -------------------------------- ### Bash Git Branching and Quality Checks Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Outlines the steps for creating a feature branch, making code changes, and running quality checks before submitting a pull request. This includes formatting code with `black` and `isort`, linting with `flake8` and `mypy`, and running tests with `pytest`. ```bash # Create Feature Branch git checkout -b feature/descriptive-name # Run Quality Checks # Format your changes black src/ tests/ isort src/ tests/ # Run linters (some existing code may have issues - focus on your changes) flake8 src/ mypy src/ # Run tests pytest # Commit Changes git add . git commit -m "type(scope): description" # Push to Fork git push origin feature/descriptive-name ``` -------------------------------- ### Configure and Run Revenium MCP Server Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Sets the logging level to debug in the environment file and executes the MCP server module. ```bash # Add to .env file echo "LOG_LEVEL=DEBUG" >> .env # Run server python -m revenium_mcp_server ``` -------------------------------- ### Revenium MCP Server Directory Structure Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Illustrates the typical directory structure of the `src/revenium_mcp_server` module, highlighting key components like the main entry point (`enhanced_server.py`), authentication (`auth.py`), API client (`client.py`), and tool management modules. ```tree src/revenium_mcp_server/ ├── __init__.py ├── enhanced_server.py # Main MCP server entry point ├── auth.py # Authentication configuration ├── client.py # Revenium API client ├── constants.py # Centralized constants ├── tools_decomposed/ # Individual MCP tools ├── capability_manager/ # Tool capability discovery └── ai_routing/ # Optional AI query routing ``` -------------------------------- ### Configure Development Environment Variables (.env) Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Creates a `.env` file in the project root to store essential configuration variables for development, such as API keys and team IDs. Supports optional settings for tool profiles, AI routing, and logging levels. Avoids using `export` commands. ```bash # Create .env file for development cat > .env << EOF # Required REVENIUM_API_KEY=your_revenium_api_key REVENIUM_TEAM_ID=your_team_id # Optional - tool profile (starter or business) TOOL_PROFILE=starter # Optional - for AI routing feature # OPENAI_API_KEY=your_openai_api_key # AI_ROUTING_ENABLED=true # Optional - debug logging # LOG_LEVEL=DEBUG EOF ``` -------------------------------- ### Verify API Authentication and Endpoints Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Commands to verify the existence of the API key and test connectivity to Revenium API endpoints using cURL. ```bash # Verify .env file exists and has API key cat .env | grep REVENIUM_API_KEY # Test API connection curl -H "x-api-key: YOUR_KEY_FROM_ENV" https://api.revenium.ai/profitstream/v2/api/sources/ai/anomaly ``` -------------------------------- ### Lint Code with Flake8, Mypy, and Pylint Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Provides commands to run various linters (`flake8`, `mypy`, `pylint`) for code quality checks and `autopep8` for automatically fixing common style issues. Ensures adherence to Python style guidelines and best practices. ```bash # Run all linters flake8 src/ mypy src/ pylint src/ # Fix common issues automatically autopep8 --in-place --recursive src/ ``` -------------------------------- ### Test Revenium API Endpoints Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Specific cURL commands to validate the anomaly and products endpoints of the Revenium API. ```bash # Test anomaly endpoint curl -H "x-api-key: YOUR_KEY" \ https://api.revenium.ai/profitstream/v2/api/sources/ai/anomaly # Test products endpoint curl -H "x-api-key: YOUR_KEY" \ https://api.revenium.ai/profitstream/v2/api/products ``` -------------------------------- ### Integrate MCP Server with Claude Code using Python venv Source: https://github.com/revenium/revenium-mcp/blob/main/README.md This option details how to integrate the Revenium MCP server with Claude Code when using a Python virtual environment. It covers creating and activating the venv, installing the package, and then adding it to Claude Code using the venv's Python interpreter, specifying environment variables via the `-e` flag. ```bash # Create and activate virtual environment python -m venv revenium-mcp-env source revenium-mcp-env/bin/activate # On Windows: revenium-mcp-env\Scripts\activate # Install package pip install revenium-mcp # Add to Claude Code using venv python (starter profile - default) claude mcp add revenium \ -e REVENIUM_API_KEY=hak_your_api_key_here \ -- ./revenium-mcp-env/bin/python -m revenium_mcp ``` -------------------------------- ### Bash Git Commit Message Format Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Defines the standard format for Git commit messages in the Revenium MCP project. This structured approach includes a type, scope, brief description, detailed explanation, and optional breaking change information, promoting consistency and clarity in version control. ```bash type(scope): brief description Detailed explanation of what changed and why. BREAKING CHANGE: description of breaking change (if applicable) Fixes #issue_number ``` -------------------------------- ### Python Configuration Constants for Revenium MCP Source: https://github.com/revenium/revenium-mcp/blob/main/DEVELOPMENT.md Defines constants for API configuration, rate limiting, and profile settings in the Revenium MCP server. These constants serve as a single source of truth to prevent duplication and ensure consistency across the application. They are intended to be imported and used instead of hardcoding values. ```python # API Configuration DEFAULT_BASE_URL = "https://api.revenium.ai" # Base URL without /meter or /profitstream paths API_SUPPORTED_VERSIONS = ["v2"] # Current API version - all endpoints use v2 AUTHENTICATION_METHODS = ["api_key"] # Supported authentication methods # Rate Limiting API_RATE_LIMIT_PER_MINUTE = 1000 # Requests per minute limit API_BURST_LIMIT = 100 # Burst request limit # Profile Configuration DEFAULT_PROFILE = "starter" # Default tool profile if not specified MCP_SERVER_VERSION = get_package_version() # MCP server version - dynamically retrieved ``` -------------------------------- ### Configure MCP Server Profiles with .env and uvx Source: https://github.com/revenium/revenium-mcp/blob/main/README.md This code demonstrates how to configure the Revenium MCP server to use either the 'starter' or 'business' profile by modifying the TOOL_PROFILE setting in the .env file before running the server with uvx. The starter profile is the default. ```bash # Starter Profile (7 tools) - Cost monitoring, alerts, AI metering integration (default) cat > .env << EOF REVENIUM_API_KEY=hak_your_api_key_here TOOL_PROFILE=starter EOF uvx revenium-mcp # Business Profile (15 tools) - Usage-based billing & AI Analytics cat > .env << EOF REVENIUM_API_KEY=hak_your_api_key_here TOOL_PROFILE=business EOF uvx revenium-mcp ``` -------------------------------- ### Run Development and Testing Tasks Source: https://github.com/revenium/revenium-mcp/blob/main/README.md Commands for executing the test suite, generating coverage reports, and running code quality tools like black, isort, and mypy. ```bash pytest black . isort . mypy . flake8 pytest --cov=revenium_mcp_server --cov-report=html ``` -------------------------------- ### Integrate MCP Server with Claude Code using uvx Source: https://github.com/revenium/revenium-mcp/blob/main/README.md This snippet shows how to add the Revenium MCP server to Claude Code using uvx. It includes commands for both the default starter profile and the business profile, utilizing the `-e` flag to pass environment variables like REVENIUM_API_KEY and TOOL_PROFILE. ```bash # Install uv if you don't have it pip install uv # Starter profile (default) claude mcp add revenium \ -e REVENIUM_API_KEY=hak_your_api_key_here \ -- uvx revenium-mcp # Business profile (for advanced features) claude mcp add revenium \ -e REVENIUM_API_KEY=hak_your_api_key_here \ -e TOOL_PROFILE=business \ -- uvx revenium-mcp ``` -------------------------------- ### Verify API Key Configuration Source: https://github.com/revenium/revenium-mcp/blob/main/README.md Commands to check if the REVENIUM_API_KEY is correctly set in the environment and verify that the server can load it successfully. ```bash cat .env | grep REVENIUM_API_KEY ``` ```python import os; from dotenv import load_dotenv; load_dotenv(); print('API Key:', os.getenv('REVENIUM_API_KEY', 'NOT FOUND')[:20] + '...') ``` -------------------------------- ### Manage Products with manage_products Source: https://context7.com/revenium/revenium-mcp/llms.txt Provides functions to create, retrieve, update, and delete product offerings. Supports configuration for usage-based pricing, tiered structures, and publication status. ```python manage_products(action="create", product_data={"name": "AI Analytics Pro", "description": "Advanced AI analytics with premium support", "usageBasedPricing": True, "costMultiplier": 1.25, "monthlyBasePrice": 99.00, "published": True}) manage_products(action="get", product_id="prod_123") manage_products(action="update", product_id="prod_123", product_data={"costMultiplier": 1.30, "monthlyBasePrice": 149.00}) manage_products(action="delete", product_id="prod_123") ``` -------------------------------- ### Manage AI Products and Pricing Source: https://context7.com/revenium/revenium-mcp/llms.txt Interface for listing and managing AI products, supporting various monetization models like usage-based or subscription pricing. ```python manage_products(action="list") ``` -------------------------------- ### Enable AI Routing in .env File Source: https://github.com/revenium/revenium-mcp/blob/main/README.md To enable the AI-powered query routing feature, you need to set specific environment variables in your .env file. This includes your Revenium API key, OpenAI API key, and enabling AI routing. An optional model name can also be specified. ```bash # .env REVENIUM_API_KEY=hak_your_api_key_here OPENAI_API_API_KEY=sk-your_openai_key_here AI_ROUTING_ENABLED=true AI_MODEL_NAME=gpt-3.5-turbo # Optional: default model ``` -------------------------------- ### Verify MCP Configuration for Claude Code Source: https://github.com/revenium/revenium-mcp/blob/main/README.md Command to list configured MCP servers to ensure the API key is correctly registered. ```bash claude mcp list ``` -------------------------------- ### Manage AI Spending Alerts with Python Source: https://context7.com/revenium/revenium-mcp/llms.txt Demonstrates how to create, list, query, update, enable, and disable AI spending alerts using the `manage_alerts` function in Python. Supports various alert types like Budget Threshold and Spike Detection, with options for persistence, notifications, and metric filtering. ```python # Create a monthly budget alert (Budget Threshold type) # Tracks cumulative usage over time periods and resets each period manage_alerts( action="create_cumulative_usage_alert", name="Monthly AI Budget", threshold=5000, period="monthly", # Options: daily, weekly, monthly, quarterly email="finance@company.com" ) # Create a real-time spike detection alert (Threshold type) # Triggers immediately when values exceed threshold within check period manage_alerts( action="create_threshold_alert", name="Cost Spike Alert", threshold=100, period_minutes=5, # Check every 5 minutes email="alerts@company.com" ) # Create alert with persistence-based triggering # Only triggers if condition persists for specified duration manage_alerts( action="create_threshold_alert", name="Sustained Cost Spike", threshold=200, period_minutes=5, triggerAfterPersistsDuration="FIFTEEN_MINUTES", # Must persist 15 min email="ops@company.com" ) # Create provider-specific alert with metric filtering manage_alerts( action="create", resource_type="anomalies", anomaly_data={ "name": "OpenAI Monthly Budget", "alertType": "CUMULATIVE_USAGE", "metricType": "TOTAL_COST", "threshold": 2000, "periodDuration": "MONTHLY", "notificationAddresses": ["ai-team@company.com"], "filters": [ {"dimension": "PROVIDER", "operator": "CONTAINS", "value": "openai"} ] } ) # Create token usage alert for specific model manage_alerts( action="create", resource_type="anomalies", anomaly_data={ "name": "GPT-4 Token Alert", "alertType": "THRESHOLD", "metricType": "TOKEN_COUNT", "threshold": 1000000, "periodDuration": "ONE_HOUR", "filters": [ {"dimension": "MODEL", "operator": "CONTAINS", "value": "gpt-4"} ] } ) # List all alert definitions (anomalies) manage_alerts(action="list", resource_type="anomalies") # List historical fired alerts (events) manage_alerts(action="list", resource_type="alerts") # Query alerts with natural language manage_alerts( action="query", resource_type="alerts", query="show high cost alerts from last week" ) # Update an existing alert manage_alerts( action="update", anomaly_id="5jXPdv", anomaly_data={ "threshold": 500, "slackConfigurations": ["slack_config_123"], "notificationAddresses": ["new-email@company.com"] } ) # Enable/disable alerts manage_alerts(action="enable", anomaly_id="alert_123") manage_alerts(action="disable", anomaly_id="alert_123") manage_alerts(action="enable_all", confirm=True) ``` -------------------------------- ### Configure Slack Integration Source: https://context7.com/revenium/revenium-mcp/llms.txt Utilities to manage Slack workspace connections, including OAuth workflows, configuration listing, and setting default alert channels. ```python slack_management(action="guided_setup") slack_management(action="initiate_oauth") slack_management(action="list_configurations") slack_management(action="set_default_configuration", config_id="slack_config_123") slack_management(action="setup_status") ``` -------------------------------- ### Analyze AI Business Metrics and Anomalies Source: https://context7.com/revenium/revenium-mcp/llms.txt Tools for analyzing AI costs and usage patterns. Supports cost summaries, breakdowns by dimension, anomaly detection with sensitivity levels, and trend analysis. ```python ai_business_analytics(action="get_summary", time_range="last_24_hours") ai_business_analytics(action="get_breakdown", dimension="provider", time_range="last_7_days") ai_business_analytics(action="detect_anomalies", dimension="all", time_range="last_30_days", sensitivity="aggressive", min_threshold=50) ai_business_analytics(action="get_trends", time_range="last_30_days", granularity="daily") ai_business_analytics(action="investigate_spike", date="2024-01-15", compare_to="previous_day") ``` -------------------------------- ### Manage Subscriptions with manage_subscriptions Source: https://context7.com/revenium/revenium-mcp/llms.txt Facilitates subscription lifecycle management including product discovery, billing cycle configuration, and safety validations. Used to create, track, and cancel customer subscriptions. ```python manage_subscriptions(action="discover_products", search_query="analytics") manage_subscriptions(action="validate_product_for_subscription", product_id="prod_123") manage_subscriptions(action="create", subscription_data={"productId": "prod_123", "subscriberEmail": "customer@company.com", "billingCycle": "MONTHLY", "startDate": "2024-01-01"}) ``` -------------------------------- ### Manage Customers and Organizations with manage_customers Source: https://context7.com/revenium/revenium-mcp/llms.txt Handles the administration of customer relationships, including organizations and users. Allows for listing, retrieving, creating, and updating profile data and roles. ```python manage_customers(action="list", resource_type="organizations") manage_customers(action="get", resource_type="users", email="user@company.com") manage_customers(action="create", resource_type="organizations", organization_data={"name": "Acme Corp", "description": "Enterprise customer", "billingEmail": "billing@acme.com"}) ``` -------------------------------- ### Environment Configuration Source: https://context7.com/revenium/revenium-mcp/llms.txt Sets required environment variables for the MCP server, including API keys and profile selection. ```bash export REVENIUM_API_KEY=hak_your_api_key_here export TOOL_PROFILE=starter export REVENIUM_TEAM_ID=ABC123x ``` -------------------------------- ### System Diagnostics and Health Checks Source: https://context7.com/revenium/revenium-mcp/llms.txt Tools for verifying server configuration, connectivity, and authentication status. Essential for troubleshooting and ensuring the MCP server is correctly initialized. ```python system_diagnostics(action="full_check") system_diagnostics(action="check_api") system_diagnostics(action="test_auth") ``` -------------------------------- ### manage_alerts Tool Source: https://context7.com/revenium/revenium-mcp/llms.txt The manage_alerts tool allows AI agents to create, update, list, and manage spending alerts and anomaly detection rules within the Revenium platform. ```APIDOC ## TOOL manage_alerts ### Description Create and manage AI-powered anomaly detection rules, including budget thresholds and real-time spike detection. Supports filtering by provider, model, or customer, and integrates with Slack/email notifications. ### Method MCP Tool Execution (JSON-RPC 2.0) ### Parameters #### Request Body - **action** (string) - Required - The operation to perform: "create", "create_cumulative_usage_alert", "create_threshold_alert", "list", "query", "update", "enable", "disable", "enable_all". - **resource_type** (string) - Optional - The resource to target: "anomalies" or "alerts". - **anomaly_data** (object) - Optional - Configuration object for creating or updating an alert (e.g., name, threshold, periodDuration, filters). - **anomaly_id** (string) - Optional - The unique identifier of the alert to update or toggle. - **query** (string) - Optional - Natural language query string for searching alerts. ### Request Example { "action": "create", "resource_type": "anomalies", "anomaly_data": { "name": "GPT-4 Token Alert", "alertType": "THRESHOLD", "metricType": "TOKEN_COUNT", "threshold": 1000000, "filters": [{"dimension": "MODEL", "operator": "CONTAINS", "value": "gpt-4"}] } } ### Response #### Success Response (200) - **status** (string) - The result of the operation. - **data** (object/array) - The requested alert definitions or event logs. #### Response Example { "status": "success", "data": { "id": "5jXPdv", "name": "GPT-4 Token Alert", "enabled": true } } ``` -------------------------------- ### Integrate AI Transaction Metering Source: https://context7.com/revenium/revenium-mcp/llms.txt Methods to submit, track, and verify AI transaction data. Includes support for subscriber attribution, task categorization, and transaction status lookups. ```python manage_metering(action="submit_ai_transaction", model="gpt-4", provider="openai", input_tokens=1500, output_tokens=500, duration_ms=2500, organization_id="org_123", task_type="chat_completion", agent="customer-support-bot") manage_metering(action="lookup_transactions", transaction_id="tx_abc123def456") manage_metering(action="get_transaction_status", transaction_id="tx_abc123def456") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.