Skip to main content
Glama
victor-velazquez-ai

Enterprise MCP Template

update_record

Modify existing records in enterprise systems like Salesforce or NetSuite by specifying record type, ID, and field updates. This tool handles API integration and authentication for data management tasks.

Instructions

Update an existing record in the upstream API.

Args: record_type: The type of record (e.g., "customer", "invoice") record_id: Internal ID of the record. updates: Dictionary of fields to update. account_id: Account ID (required if not configured on server). base_url: Optional full API URL (overrides account_id).

Returns: Structured response with update result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
record_typeYes
record_idYes
updatesYes
account_idNo
base_urlNo

Implementation Reference

  • The MCP tool handler for 'update_record', which accepts user input and calls the API client.
    async def update_record(
        record_type: str,
        record_id: str,
        updates: Dict[str, Any],
        account_id: Optional[str] = None,
        base_url: Optional[str] = None,
    ) -> Dict[str, Any]:
        """
        Update an existing record in the upstream API.
    
        Args:
            record_type: The type of record (e.g., "customer", "invoice")
            record_id: Internal ID of the record.
            updates: Dictionary of fields to update.
            account_id: Account ID (required if not configured on server).
            base_url: Optional full API URL (overrides account_id).
    
        Returns:
            Structured response with update result.
        """
        token = _get_oauth_token()
    
        async with _get_client(base_url, account_id) as client:
            response = await client.update_record(
                access_token=token,
                record_type=record_type,
                record_id=record_id,
                payload=updates,
                base_url_override=base_url,
  • The actual implementation of the update_record logic that performs the PATCH request to the API.
    async def update_record(
        self,
        access_token: str,
        record_type: str,
        record_id: str,
        payload: Dict[str, Any],
        base_url_override: Optional[str] = None,
    ) -> APIResponse:
        """
        Update an existing record (partial update via PATCH).
        
        Args:
            access_token: OAuth Bearer token
            record_type: The record type/endpoint name
            record_id: The record's internal ID
            payload: Fields to update
            base_url_override: Override the base URL
        """
        base = base_url_override or self._base_url
        url = f"{base}/{record_type}/{record_id}"
        
        logger.info(f"Updating {record_type} #{record_id}")
        return await self._request_with_retry("PATCH", url, access_token, json_body=payload)

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