Skip to main content
Glama

show_build_set_ws

Display Xcode project build settings by specifying workspace path and scheme using xcodebuild to configure development environments.

Instructions

Shows build settings from a workspace using xcodebuild. IMPORTANT: Requires workspacePath and scheme. Example: show_build_set_ws({ workspacePath: '/path/to/MyProject.xcworkspace', scheme: 'MyScheme' })

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspacePathYesPath to the .xcworkspace file (Required)
schemeYesThe scheme to use (Required)

Implementation Reference

  • Core handler logic shared by workspace and project tools. Executes `xcodebuild -showBuildSettings` with appropriate flags and formats the response.
    async function _handleShowBuildSettingsLogic(params: {
      workspacePath?: string;
      projectPath?: string;
      scheme: string;
    }): Promise<ToolResponse> {
      log('info', `Showing build settings for scheme ${params.scheme}`);
    
      try {
        // Create the command array for xcodebuild
        const command = ['xcodebuild', '-showBuildSettings']; // -showBuildSettings as an option, not an action
    
        // Add the workspace or project
        if (params.workspacePath) {
          command.push('-workspace', params.workspacePath);
        } else if (params.projectPath) {
          command.push('-project', params.projectPath);
        }
    
        // Add the scheme
        command.push('-scheme', params.scheme);
    
        // Execute the command directly
        const result = await executeCommand(command, 'Show Build Settings');
    
        if (!result.success) {
          return createTextResponse(`Failed to show build settings: ${result.error}`, true);
        }
    
        return {
          content: [
            {
              type: 'text',
              text: `✅ Build settings for scheme ${params.scheme}:`,
            },
            {
              type: 'text',
              text: result.output || 'Build settings retrieved successfully.',
            },
          ],
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        log('error', `Error showing build settings: ${errorMessage}`);
        return createTextResponse(`Error showing build settings: ${errorMessage}`, true);
      }
    }
  • Registers the 'show_build_set_ws' tool on the MCP server, including input schema, description, and handler wrapper with validation.
    export function registerShowBuildSettingsWorkspaceTool(server: McpServer): void {
      registerTool<BaseWorkspaceParams>(
        server,
        'show_build_set_ws',
        "Shows build settings from a workspace using xcodebuild. IMPORTANT: Requires workspacePath and scheme. Example: show_build_set_ws({ workspacePath: '/path/to/MyProject.xcworkspace', scheme: 'MyScheme' })",
        {
          workspacePath: workspacePathSchema,
          scheme: schemeSchema,
        },
        async (params: BaseWorkspaceParams) => {
          // Validate required parameters
          const workspaceValidation = validateRequiredParam('workspacePath', params.workspacePath);
          if (!workspaceValidation.isValid) return workspaceValidation.errorResponse!;
    
          const schemeValidation = validateRequiredParam('scheme', params.scheme);
          if (!schemeValidation.isValid) return schemeValidation.errorResponse!;
    
          return _handleShowBuildSettingsLogic(params);
        },
      );
    }
  • Input schema for the tool: workspacePath (string, required) and scheme (string, required).
      workspacePath: workspacePathSchema,
      scheme: schemeSchema,
    },
  • Entry in toolRegistrations array that conditionally registers the tool during server initialization.
      register: registerShowBuildSettingsWorkspaceTool,
      groups: [ToolGroup.PROJECT_DISCOVERY],
      envVar: 'XCODEBUILDMCP_TOOL_SHOW_BUILD_SETTINGS_WORKSPACE',
    },
  • Zod schema for the 'scheme' parameter used by the tool.
    export const schemeSchema = z.string().describe('The scheme to use (Required)');
  • Zod schema for the 'workspacePath' parameter used by the tool.
    export const workspacePathSchema = z.string().describe('Path to the .xcworkspace file (Required)');
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions that the tool 'shows' build settings, implying a read-only operation, but doesn't disclose behavioral traits such as whether it has side effects, requires specific permissions, or how it handles errors. The description adds minimal context beyond the basic action.

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 appropriately sized with two sentences: one stating the purpose and requirements, and another providing an example. It's front-loaded with key information and avoids unnecessary details, though the example could be slightly more concise.

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

Completeness3/5

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

Given the tool's moderate complexity (2 required parameters, no output schema, and no annotations), the description is somewhat complete but lacks depth. It covers the basic action and parameters but doesn't explain what 'build settings' includes, potential output format, or integration with sibling tools, leaving gaps for effective agent use.

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?

The input schema has 100% description coverage, clearly documenting both required parameters. The description adds value by emphasizing that both parameters are required and providing an example, but it doesn't add significant meaning beyond what the schema already specifies, such as format details or constraints.

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 clearly states the verb 'shows' and the resource 'build settings from a workspace using xcodebuild', making the purpose specific and understandable. However, it doesn't explicitly differentiate from its sibling 'show_build_set_proj', which appears to be a similar tool for projects rather than workspaces, leaving some ambiguity in sibling differentiation.

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

Usage Guidelines3/5

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

The description implies usage context by specifying that it requires 'workspacePath and scheme' and mentions xcodebuild, but it doesn't provide explicit guidance on when to use this tool versus alternatives like 'show_build_set_proj' or other build-related siblings. The example helps illustrate usage but doesn't clarify distinctions.

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/SampsonKY/XcodeBuildMCP'

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