Skip to main content
Glama
victor-velazquez-ai

Enterprise MCP Template

get_record

Retrieve specific records from enterprise systems by ID, supporting customers, invoices, and other data types with optional related information.

Instructions

Fetch a record from the upstream API by ID.

Args: record_type: The type of record (e.g., "customer", "invoice") record_id: Internal ID of the record. account_id: Account ID (required if not configured on server). base_url: Optional full API URL (overrides account_id). expand_sub_resources: Include full sublist/related data.

Returns: Structured response with record data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
record_typeYes
record_idYes
account_idNo
base_urlNo
expand_sub_resourcesNo

Implementation Reference

  • The get_record tool handler registered with @mcp.tool() in src/my_mcp_server/server.py. It retrieves the OAuth token, uses a configured API client to fetch the record, and serializes the response.
    async def get_record(
        record_type: str,
        record_id: str,
        account_id: Optional[str] = None,
        base_url: Optional[str] = None,
        expand_sub_resources: bool = False,
    ) -> Dict[str, Any]:
        """
        Fetch a record from the upstream API by ID.
    
        Args:
            record_type: The type of record (e.g., "customer", "invoice")
            record_id: Internal ID of the record.
            account_id: Account ID (required if not configured on server).
            base_url: Optional full API URL (overrides account_id).
            expand_sub_resources: Include full sublist/related data.
    
        Returns:
            Structured response with record data.
        """
        token = _get_oauth_token()
    
        async with _get_client(base_url, account_id) as client:
            response = await client.get_record(
                access_token=token,
                record_type=record_type,
                record_id=record_id,
                base_url_override=base_url,
                expand_sub_resources=expand_sub_resources,
            )
            return _serialize_response(response)

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/victor-velazquez-ai/enterprise-mcp-template'

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