Skip to main content
Glama

get_db_instrumentation

Retrieve instrumentation configuration for specific database types (MySQL, PostgreSQL, Redis, MongoDB, Memcached) by providing project ID, application ID, and database type. Simplifies database monitoring integration in the Coroot observability platform.

Instructions

Get database instrumentation configuration.

Retrieves instrumentation settings for a specific database type.

Args: project_id: Project ID app_id: Application ID (format: namespace/kind/name) db_type: Database type (mysql, postgres, redis, mongodb, memcached)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYes
db_typeYes
project_idYes

Implementation Reference

  • Primary MCP tool handler for 'get_db_instrumentation'. Decorated with @mcp.tool() for registration. Defines input schema via type hints and docstring. Delegates to internal implementation.
    @mcp.tool() async def get_db_instrumentation( project_id: str, app_id: str, db_type: str ) -> dict[str, Any]: """Get database instrumentation configuration. Retrieves instrumentation settings for a specific database type. Args: project_id: Project ID app_id: Application ID (format: namespace/kind/name) db_type: Database type (mysql, postgres, redis, mongodb, memcached) """ return await get_db_instrumentation_impl(project_id, app_id, db_type) # type: ignore[no-any-return]
  • Internal helper implementation in server.py that obtains the CorootClient instance and calls the client's get_db_instrumentation method, wrapping the result in a success dict.
    @handle_errors async def get_db_instrumentation_impl( project_id: str, app_id: str, db_type: str ) -> dict[str, Any]: """Get database instrumentation config.""" client = get_client() config = await client.get_db_instrumentation(project_id, app_id, db_type) return { "success": True, "config": config, }
  • CorootClient helper method that URL-encodes the app_id and makes a GET request to the Coroot API to fetch database instrumentation configuration, returning the raw JSON data.
    async def get_db_instrumentation( self, project_id: str, app_id: str, db_type: str ) -> dict[str, Any]: """Get database instrumentation configuration. Args: project_id: Project ID. app_id: Application ID. db_type: Database type (mysql, postgres, redis, mongodb, memcached). Returns: Database instrumentation configuration. """ # URL encode the app_id since it contains slashes from urllib.parse import quote encoded_app_id = quote(app_id, safe="") response = await self._request( "GET", f"/api/project/{project_id}/app/{encoded_app_id}/instrumentation/{db_type}", ) data: dict[str, Any] = response.json() return data

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/jamesbrink/mcp-coroot'

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