Skip to main content
Glama

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax snippets to return (default 5)
topicYesTopic to find code for (e.g. 'batch apex', 'REST callout', 'SOQL aggregate')
domainNoOptional domain filter (e.g. 'apex-guide', 'lwc')
languageNoOptional language filter (e.g. 'apex', 'javascript', 'soql', 'json')
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description takes on responsibility for behavior. It discloses that the tool returns snippets with language, source file, and surrounding context, and implies read-only search. It doesn't cover result limits, error cases, or access requirements, but for this tool type the core behavior is covered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with action and resource, then a brief value statement. No filler; each sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description covers purpose, main output fields, and an example use case. It is sufficient for a simple lookup tool, though it could mention how domain filters affect results or differentiate from generic search.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema covers all four parameters with descriptions (100% coverage), so baseline is 3. The description adds little param-specific detail beyond the schema, only relating output fields to language and context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description opens with a clear verb ('Find') and specific resource ('working code examples from Salesforce documentation'), and further clarifies output as code snippets. It doesn't explicitly contrast with sibling search tools like sf_search or sf_semantic_search, so it falls just short of full differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States it is 'Great for learning patterns and copy-paste solutions,' giving clear use context. It does not mention when to prefer alternatives or exclusions, but provides enough orientation for a search tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Avinava/sf-documentation-knowledge'

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