Skip to main content
Glama

add_swift_package

Add a Swift Package dependency to your active Xcode project by URL and version. Prerequisite: SPM must be initialized with a Package.swift file; if not, initialize it first.

Instructions

Adds a Swift Package dependency to the active project. Note: Your project must already be set up for Swift Package Manager (must have a Package.swift file). If you haven't initialized SPM yet, use the init_swift_package tool first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the Swift package to add
versionNoVersion requirement (e.g., 'exact: 1.0.0', 'from: 1.0.0', 'branch: main')
skipUpdateNoSkip running 'package update' after adding the dependency
productNameNoSpecific product name to add from the package
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. It discloses the prerequisite (existing Package.swift) and directs to init_swift_package otherwise, but it does not mention side effects such as modifying Package.swift or running 'package update' by default. This is useful context but incomplete for a mutation tool.

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 tightly packed sentences: the first states the core action, the second provides a critical prerequisite and alternative. No wasted words, and the most important info is front-loaded.

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?

The tool is relatively simple with 4 well-documented parameters and no output schema. The description covers the primary prerequisite and alternative, which is sufficient for most use cases. It could be improved by noting the default behavior around package update, but the schema's skipUpdate parameter hints at that.

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% for all 4 parameters, and the schema provides detailed descriptions (e.g., version requirement syntax). The description adds no parameter-level information, but per the baseline for high coverage, a 3 is appropriate.

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 uses a specific verb 'Adds' and identifies the resource ('Swift Package dependency') and scope ('active project'), clearly distinguishing it from sibling tools like init_swift_package and remove_swift_package.

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?

Provides explicit guidance on when to use the tool (must have Package.swift) and names the alternative tool (init_swift_package) if the prerequisite isn't met, offering clear exclusions and next steps.

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/r-huijts/xcode-mcp-server'

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