Skip to main content
Glama
conorluddy

XC-MCP: XCode CLI wrapper

by conorluddy

Clear Simulator Keychain

idb-clear-keychain
DestructiveIdempotent

Clear a simulator's keychain to reset credentials that survive app uninstall, ensuring a genuinely clean state for onboarding or authentication tests.

Instructions

idb-clear-keychain

Clear a simulator's keychain, for test isolation.

Overview

Keychain entries survive app uninstall — that is the point of the keychain, and it is why a "fresh install" test can still start logged in. Clearing it gives a genuinely clean credential state before an onboarding or authentication test.

Parameters

Optional

  • udid (string): Target identifier - auto-detects if omitted

  • scenario (string): Test scenario name, recorded in the audit entry

  • step (number): Step number within the scenario

Returns

Confirmation with an audit entry (timestamp, action, scenario, step).

Examples

// Genuinely clean login state — uninstalling the app alone would not do this
await idbClearKeychainTool({ scenario: 'First-run onboarding' });
await workflowFreshInstallTool({ projectPath: './MyApp.xcodeproj', scheme: 'MyApp' });
  • workflow-fresh-install: Wipes app data, but NOT the keychain

  • simctl-erase: Factory-resets the whole simulator (heavier; also clears the keychain)

  • simctl-privacy: Reset permission grants, the other thing that survives reinstall

Notes

  • Destructive: clears credentials for EVERY app on the simulator, not just yours.

  • Cheaper and more targeted than simctl-erase when credentials are all you need reset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stepNoStep number within the scenario
udidNo
scenarioNoTest scenario name for the audit entry

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already carry destructiveHint=true, readOnlyHint=false, and idempotentHint=true, but the description adds genuinely valuable context beyond them: 'clears credentials for EVERY app on the simulator, not just yours' — scoping exactly what gets destroyed, which the annotation cannot convey. It also discloses cost/weight relative to simctl-erase ('Cheaper and more targeted'). Nothing contradicts the annotations.

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

Conciseness4/5

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

The description is long but well-structured with clear headers (Overview, Parameters, Returns, Examples, Related Tools, Notes), and the key behavioral insight (uninstall doesn't clear keychain) is front-loaded in the overview. Each section earns its place — examples illustrate a real composed workflow and the destructive scope warning is critical. Slightly verbose for such a simple tool, but nothing is wasted.

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

Completeness5/5

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

Complete for a destructive 3-param tool with no output schema. The description documents the return format (confirmation with audit entry: timestamp, action, scenario, step), covers all parameters, provides a worked example, routes to related tools, and warns about the destructive scope. Nothing an agent needs to invoke it correctly is missing.

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 coverage is 67%; the schema documents step and scenario but not udid. The description's Parameters section lists all three and adds one useful fact — udid 'auto-detects if omitted' — plus notes the scenario is recorded in the audit entry. This is modest added value that mostly echoes the schema rather than deeply enriching parameter meaning.

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?

States a specific verb (clear), resource (simulator keychain), and purpose (test isolation). The overview explains why this matters — keychain entries survive app uninstall, so a fresh-install test can still be logged in. It clearly distinguishes from siblings: workflow-fresh-install (wipes data but not keychain), simctl-erase (heavier factory reset), and simctl-privacy (permission grants).

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?

The Related Tools section explicitly names alternatives and the precise condition that selects this tool versus them, including what each sibling does and does not do (e.g., 'workflow-fresh-install: Wipes app data, but NOT the keychain'). The example pairs it with workflow-fresh-install to demonstrate the correct composed workflow for a clean-login test.

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