Skip to main content
Glama

swift_package_list

Identify active Swift Package processes on XcodeBuildMCP to monitor and manage current tasks efficiently.

Instructions

Lists currently running Swift Package processes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that implements the logic to list active Swift Package processes, calculating runtime and formatting the output.
    export async function swift_package_listLogic(
      params?: unknown,
      dependencies?: ProcessListDependencies,
    ): Promise<ToolResponse> {
      const processMap = dependencies?.processMap ?? activeProcesses;
      const arrayFrom = dependencies?.arrayFrom ?? Array.from;
      const dateNow = dependencies?.dateNow ?? Date.now;
    
      const processes = arrayFrom(processMap.entries());
    
      if (processes.length === 0) {
        return {
          content: [
            createTextContent('â„šī¸ No Swift Package processes currently running.'),
            createTextContent('💡 Use swift_package_run to start an executable.'),
          ],
        };
      }
    
      const content = [createTextContent(`📋 Active Swift Package processes (${processes.length}):`)];
    
      for (const [pid, info] of processes) {
        // Use logical OR instead of nullish coalescing to treat empty strings as falsy
        // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
        const executableName = info.executableName || 'default';
        const runtime = Math.max(1, Math.round((dateNow() - info.startedAt.getTime()) / 1000));
        content.push(
          createTextContent(
            `  â€ĸ PID ${pid}: ${executableName} (${info.packagePath}) - running ${runtime}s`,
          ),
        );
      }
    
      content.push(createTextContent('💡 Use swift_package_stop with a PID to terminate a process.'));
    
      return { content };
    }
  • Zod schema definition for tool parameters (empty since no input parameters are required) and inferred TypeScript type.
    const swiftPackageListSchema = z.object({});
    
    // Use z.infer for type safety
    type SwiftPackageListParams = z.infer<typeof swiftPackageListSchema>;
  • Tool registration as default export, including name, description, schema, and a typed handler wrapper around the core logic.
    export default {
      name: 'swift_package_list',
      description: 'Lists currently running Swift Package processes',
      schema: swiftPackageListSchema.shape, // MCP SDK compatibility
      handler: createTypedTool(
        swiftPackageListSchema,
        (params: SwiftPackageListParams) => {
          return swift_package_listLogic(params);
        },
        getDefaultCommandExecutor,
      ),
    };
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only states what the tool does ('Lists'), but doesn't describe what information is returned, format of output, whether it's a snapshot or live view, permissions required, or any side effects. For a tool with zero annotation coverage, 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 that communicates the core purpose without any wasted words. It's appropriately sized for a simple listing tool and front-loads the essential information.

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 'lists' means in practice - what information is returned, in what format, or how the agent should interpret the results. For a tool that presumably returns process information, more context about the output would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the lack of parameters. The description appropriately doesn't mention parameters since none exist, which is correct for this case. Baseline would be 4 for 0 parameters.

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 action ('Lists') and target ('currently running Swift Package processes'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'swift_package_build' or 'swift_package_run', which also relate to Swift Package processes but perform different actions.

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?

The description provides no guidance on when to use this tool versus alternatives. There are many sibling tools for Swift Package operations (build, clean, run, stop, test), but the description doesn't indicate when listing processes is appropriate versus those other operations.

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

Related 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/getsentry/XcodeBuildMCP'

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