Skip to main content
Glama

Swift Language Reference chapter

apple_swift_book_get
Read-onlyIdempotent

Retrieve a chapter from The Swift Programming Language book by slug to read language guide or reference content. Use wwdc_search first to find the chapter slug.

Instructions

Retrieve a chapter from The Swift Programming Language book (docs.swift.org). Covers Language Guide (closures, concurrency, generics…) and Language Reference (grammar, declarations, attributes). Search with wwdc_search first to find the slug.

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": {
      "chapter": "<chapter>"
    },
    "name": "apple_swift_book_get"
  }
}

Input Schema

NameRequiredDescriptionDefault
formatNoResponse formatmarkdown
chapterYesChapter slug, e.g. 'concurrency', 'generics', 'closures'. Use wwdc_search to discover slugs.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.3
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observedv0.2.1

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare this as a read-only, idempotent, non-destructive, non-open-world operation. The description adds useful context about the covered book sections and the slug-discovery prerequisite, but it does not describe response size, pagination, error behavior for invalid slugs, or how markdown versus json output behaves.

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?

The description is three tight sentences with the primary purpose front-loaded. The coverage examples and the wwdc_search prerequisite each add useful scoping information without unnecessary wording.

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?

For a simple two-parameter retrieval tool with complete schema coverage and rich annotations, the description provides enough context to call it correctly. It could additionally mention invalid-slug behavior or output expectations, but no output schema exists and the schema already documents the format parameter.

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 the input schema already explains both the chapter slug and format parameters. The description adds topical examples of chapters, such as closures and generics, but does not add syntax or meaning beyond what the schema provides. The baseline of 3 is appropriate.

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?

The description states a specific verb and resource: retrieve a chapter from The Swift Programming Language book. It also scopes the content to Language Guide and Language Reference chapters, which makes the tool's role clear. However, it does not explicitly distinguish this from sibling documentation tools such as apple_doc_get or apple_tutorial_get.

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?

The description gives a clear prerequisite: use wwdc_search first to find the chapter slug. That is useful routing for an agent that does not already know the slug. It lacks explicit when-not guidance or comparison against other documentation retrieval tools, but the usage context is clear.

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