Skip to main content
Glama

show_build_set_proj

Extract build settings from Xcode project files using xcodebuild. Specify project path and scheme to retrieve configuration details.

Instructions

Shows build settings from a project file using xcodebuild. IMPORTANT: Requires projectPath and scheme. Example: show_build_set_proj({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme' })

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the .xcodeproj file (Required)
schemeYesThe scheme to use (Required)

Implementation Reference

  • The primary handler logic that constructs and executes the 'xcodebuild -showBuildSettings' command based on provided projectPath or workspacePath and scheme, then returns formatted output.
    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_proj' tool with the MCP server, including name, description, schema, and handler that validates params and delegates to core logic.
    export function registerShowBuildSettingsProjectTool(server: McpServer): void {
      registerTool<BaseProjectParams>(
        server,
        'show_build_set_proj',
        "Shows build settings from a project file using xcodebuild. IMPORTANT: Requires projectPath and scheme. Example: show_build_set_proj({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme' })",
        {
          projectPath: projectPathSchema,
          scheme: schemeSchema,
        },
        async (params: BaseProjectParams) => {
          // Validate required parameters
          const projectValidation = validateRequiredParam('projectPath', params.projectPath);
          if (!projectValidation.isValid) return projectValidation.errorResponse!;
    
          const schemeValidation = validateRequiredParam('scheme', params.scheme);
          if (!schemeValidation.isValid) return schemeValidation.errorResponse!;
    
          return _handleShowBuildSettingsLogic(params);
        },
      );
    }
  • Central tool registry entry that conditionally registers the show_build_set_proj tool based on environment variable.
    {
      register: registerShowBuildSettingsProjectTool,
      groups: [ToolGroup.PROJECT_DISCOVERY],
      envVar: 'XCODEBUILDMCP_TOOL_SHOW_BUILD_SETTINGS_PROJECT',
    },
  • Zod schema definitions for the required projectPath and scheme input parameters used by the tool.
    export const projectPathSchema = z.string().describe('Path to the .xcodeproj file (Required)');
    export const schemeSchema = z.string().describe('The scheme to use (Required)');
  • Utility function that wraps the tool handler and registers it on the MCP server using server.tool.
    export function registerTool<T extends object>(
      server: McpServer,
      name: string,
      description: string,
      schema: Record<string, z.ZodType>,
      handler: (params: T) => Promise<ToolResponse>,
    ): void {
      // Create a wrapper handler that matches the signature expected by server.tool
      const wrappedHandler = (
        args: Record<string, unknown>,
        _extra: unknown,
      ): Promise<ToolResponse> => {
        // Assert the type *before* calling the original handler
        // This confines the type assertion to one place
        const typedParams = args as T;
        return handler(typedParams);
      };
    
      server.tool(name, description, schema, wrappedHandler);
    }
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 of behavioral disclosure. It mentions that the tool 'shows' build settings, implying a read-only operation, but doesn't clarify if it's safe, what output format to expect, or any potential side effects. The description adds minimal behavioral 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 one providing an example. It's front-loaded with the core functionality. The example is helpful but could be slightly more concise by avoiding repetition of the tool name.

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, no annotations), the description is minimally adequate. It covers the purpose and parameters but lacks details on output format, error handling, or integration with sibling tools. Without annotations or output schema, more behavioral context would improve completeness.

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 schema already documents both parameters (projectPath and scheme) with descriptions. The description adds value by emphasizing these as required and providing an example, but it doesn't add significant meaning beyond what the schema provides, such as format details or usage nuances.

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 tool's purpose: 'Shows build settings from a project file using xcodebuild.' It specifies the verb ('shows'), resource ('build settings'), and method ('using xcodebuild'). However, it doesn't explicitly differentiate from its sibling 'show_build_set_ws', which likely shows build settings from a workspace instead of a project file.

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 mentioning the required parameters (projectPath and scheme) and providing an example, but it doesn't explicitly state when to use this tool versus alternatives like 'show_build_set_ws' or other build-related tools. The 'IMPORTANT' note about requirements serves as basic guidance but lacks comparative context.

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