Skip to main content
Glama
bbssppllvv

apple-docs-mcp-server

by bbssppllvv

get_code_examples

Extract all code examples from a specific Apple documentation document using its doc ID. Get full context and explanations for each code block.

Instructions

šŸ”— CONTEXTUAL CODE EXTRACTION: Extract code examples from a specific document you already found.

WORKFLOW INTEGRATION: • Use after search_docs: See codeBlocks: 5 → get_code_examples(doc_id) → get those 5 examples • Perfect for AI agents: Found interesting document → extract its code without re-searching • Contextual approach: Work with specific documents rather than broad searches

WHAT YOU GET: • All code examples from the specified document • Full context and explanations around each code block • Categorization and complexity analysis • Same rich metadata as extract_code_examples

USAGE PATTERN:

  1. search_docs("SwiftUI navigation") → find relevant documents

  2. See result shows "codeBlocks: 7"

  3. get_code_examples(document_id) → get all 7 examples with context

PERFECT FOR: AI agents who want to drill down into specific documents after initial search.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docIdYesDOCUMENT ID: The id field from search_docs results. Extract code examples from this specific document.
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses what the tool returns (all code examples, context, categorization, complexity analysis, metadata) and implies a read-only operation. It doesn't mention auth or error handling, but for a read-only extraction tool, this is reasonably transparent.

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

Conciseness3/5

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

The description is verbose and somewhat repetitive. It uses multiple sections (WORKFLOW INTEGRATION, USAGE PATTERN, PERFECT FOR) that overlap. While organized with headers, it could be more concise without losing key information.

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, the description compensates by listing expected return contents. It covers the tool's role within a broader search workflow. However, it omits potential error cases or authorization requirements, which would make it more complete.

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

Parameters4/5

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

Schema coverage is 100% and the description enriches the meaning of docId (from search_docs results) and ties it to a usage pattern. This goes beyond the schema's bare description by providing context and source.

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?

The description clearly states the tool extracts code examples from a specific document ('Extract code examples from a specific document you already found'). It differentiates from siblings by emphasizing a contextual, document-specific approach vs. broad search, and references search_docs integration.

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

Usage Guidelines5/5

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

Explicitly provides a workflow: 'Use after search_docs', a usage pattern with step-by-step instructions, and highlights it's perfect for AI agents drilling down after initial search. This gives clear when-to-use guidance and distinguishes from search_docs or get_doc.

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

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