Skip to main content
Glama

get_sample_code

Read-only

Access Apple's sample projects to learn by example. Search by framework or keywords to find full working code.

Instructions

Browse complete sample projects from Apple. Full working examples demonstrating best practices and implementation patterns. Different from search_apple_docs which returns code snippets. Use for learning by example.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
frameworkNoFramework filter (case-insensitive). Examples: "SwiftUI", "ARKit", "CoreML". Note: Some samples are under generic categories - use searchQuery for better results.
betaNoBeta samples: "include" = all, "exclude" = stable only, "only" = beta only. Default: "include"
searchQueryNoSearch keywords. Most effective approach. Examples: "animation", "camera", "machine learning", "widgets".
limitNoMax results (default: 50).
Behavior4/5

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

Annotations already include readOnlyHint=true. Description does not contradict and adds context about browsing full sample projects, reinforcing read-only nature. No extra behavioral details needed beyond what annotations provide.

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 informative sentences with a third differentiating from sibling. Front-loaded with purpose, no redundant words. Highly concise and structured.

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?

No output schema, but description mentions 'full working examples' which implies the result type. Lacks details on pagination or ordering, but sufficient for a browsing tool given annotations and schema coverage.

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?

Schema description coverage is 100%, so baseline is 3. Description provides examples for 'framework' and 'searchQuery' but these are already in the parameter descriptions. No additional semantic meaning beyond schema.

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

Purpose5/5

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

Description clearly states 'Browse complete sample projects from Apple' with 'Full working examples' specifying it returns complete projects, not snippets. It explicitly distinguishes from sibling 'search_apple_docs' which returns code snippets.

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 'Use for learning by example', giving clear usage intent. Also contrasts with sibling tool, providing guidance on when to use this vs alternatives. No explicit exclusions, but adequate.

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/kimsungwhee/apple-docs-mcp'

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