Skip to main content
Glama

xcode_get_workspace_info

Extract workspace details from Xcode project files to analyze project structure and configurations for build automation workflows.

Instructions

Get information about a specific workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xcodeprojYesAbsolute path to the .xcodeproj file (or .xcworkspace if available) - e.g., /path/to/project.xcodeproj

Implementation Reference

  • Primary handler function implementing the tool logic: validates project path, opens the project, executes JXA script to retrieve workspace information (name, path, loaded status, active scheme, active run destination), and returns formatted JSON.
    public static async getWorkspaceInfo(projectPath: string, openProject: OpenProjectCallback): Promise<McpResult> {
      const validationError = PathValidator.validateProjectPath(projectPath);
      if (validationError) return validationError;
    
      await openProject(projectPath);
    
      const script = `
        (function() {
          ${getWorkspaceByPathScript(projectPath)}
          
          const info = {
            name: workspace.name(),
            path: workspace.path(),
            loaded: workspace.loaded(),
            activeScheme: workspace.activeScheme() ? workspace.activeScheme().name() : null,
            activeRunDestination: workspace.activeRunDestination() ? workspace.activeRunDestination().name() : null
          };
          
          return JSON.stringify(info, null, 2);
        })()
      `;
      
      const result = await JXAExecutor.execute(script);
      return { content: [{ type: 'text', text: result }] };
    }
  • Tool definition including name, description, and input schema (requires xcodeproj path). Used by MCP server for tool listing and validation.
    {
      name: 'xcode_get_workspace_info',
      description: 'Get information about a specific workspace',
      inputSchema: {
        type: 'object',
        properties: {
          xcodeproj: {
            type: 'string',
            description: preferredXcodeproj 
              ? `Absolute path to the .xcodeproj file (or .xcworkspace if available) - defaults to ${preferredXcodeproj}`
              : 'Absolute path to the .xcodeproj file (or .xcworkspace if available) - e.g., /path/to/project.xcodeproj',
          },
        },
        required: preferredXcodeproj ? [] : ['xcodeproj'],
      },
    },
  • Dispatch handler in main MCP CallToolRequest that performs parameter validation and delegates to InfoTools.getWorkspaceInfo.
    case 'xcode_get_workspace_info':
      if (!args.xcodeproj) {
        throw new McpError(ErrorCode.InvalidParams, `Missing required parameter: xcodeproj`);
      }
      return await InfoTools.getWorkspaceInfo(args.xcodeproj as string, this.openProject.bind(this));
  • Registers all tools including xcode_get_workspace_info via getToolDefinitions() for the MCP ListToolsRequest handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      const toolOptions: {
        includeClean: boolean;
        preferredScheme?: string;
        preferredXcodeproj?: string;
      } = { includeClean: this.includeClean };
      
      if (this.preferredScheme) toolOptions.preferredScheme = this.preferredScheme;
      if (this.preferredXcodeproj) toolOptions.preferredXcodeproj = this.preferredXcodeproj;
      
      const toolDefinitions = getToolDefinitions(toolOptions);
      return {
        tools: toolDefinitions.map(tool => ({
          name: tool.name,
          description: tool.description,
          inputSchema: tool.inputSchema
        })),
      };
    });
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 only states the action without details on permissions, side effects, error handling, or output format. For a read operation with no structured safety hints, this is insufficient.

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 a single, efficient sentence with no wasted words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete. It doesn't explain what information is returned or any behavioral traits, leaving significant gaps for a tool that likely provides structured data about Xcode workspaces.

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 schema description coverage is 100%, with the single parameter 'xcodeproj' well-documented in the schema. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the verb 'Get' and resource 'information about a specific workspace', which is clear but vague. It doesn't specify what type of information is retrieved or how this differs from sibling tools like 'xcode_get_projects' or 'xcode_get_schemes', leaving the purpose somewhat ambiguous.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. With siblings like 'xcode_get_projects' and 'xcode_get_schemes', the description lacks context on whether this tool is more comprehensive or specific, offering no usage criteria or exclusions.

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/lapfelix/XcodeMCP'

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