sf_code_examples
Find working Salesforce code examples by topic, language, and domain. Returns snippets with source context for copy-paste solutions and learning patterns.
Instructions
Find working code examples from Salesforce documentation. Returns code snippets with language, source file, and surrounding context. Great for learning patterns and copy-paste solutions.
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": {
"topic": "<topic>"
},
"name": "sf_code_examples"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max snippets to return (default 5) | |
| topic | Yes | Topic to find code for (e.g. 'batch apex', 'REST callout', 'SOQL aggregate') | |
| domain | No | Optional domain filter (e.g. 'apex-guide', 'lwc') | |
| language | No | Optional language filter (e.g. 'apex', 'javascript', 'soql', 'json') |