salesforce_get_metadata_component
Fetches a single Salesforce metadata component by type and record ID through the Tooling API, returning full source or body for Apex classes, triggers, pages, and similar assets.
Instructions
Retrieve a single metadata component by type and full name using the Tooling API. Useful for getting the full body/source of an Apex class, trigger, page, etc.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"type": "<type>",
"recordId": "<recordId>"
},
"name": "salesforce_get_metadata_component"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | The Tooling API sObject type (e.g. ApexClass, ApexTrigger, ApexPage, AuraDefinitionBundle) | |
| recordId | Yes | The 15 or 18 character record ID |