Skip to main content
Glama

init

Initialize OSS Autopilot with your GitHub username. This creates the state file and sets up initial configuration for managing open source contributions.

Instructions

Initialize OSS Autopilot with a GitHub username. Creates the state file and sets up initial configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesYour GitHub username

Implementation Reference

  • The core handler function `runInit` that executes the 'init' tool logic. It validates the GitHub username and updates the config with it via `stateManager.updateConfig`.
    export async function runInit(options: { username: string }): Promise<InitOutput> {
      validateGitHubUsername(options.username);
      const stateManager = getStateManager();
    
      // Set username in config
      stateManager.updateConfig({ githubUsername: options.username });
    
      return {
        username: options.username,
        message: 'Username saved. Run `daily` to fetch your open PRs from GitHub.',
      };
    }
  • The `InitOutput` type interface defining the return shape (username and message strings).
    export interface InitOutput {
      username: string;
      message: string;
    }
  • The MCP tool registration for 'init'. Registers the tool with the server using name 'init', a description, a Zod inputSchema for `username`, and wraps `runInit` via `wrapTool`.
    // 12. init — Initialize with GitHub username
    server.registerTool(
      'init',
      {
        description:
          'Initialize OSS Autopilot with a GitHub username. Creates the state file and sets up initial configuration.',
        inputSchema: {
          username: z.string().describe('Your GitHub username'),
        },
        annotations: { readOnlyHint: false, destructiveHint: false },
      },
      wrapTool(runInit),
    );
  • The input schema for the 'init' tool, requiring a single `username` string parameter described as 'Your GitHub username'.
    // 12. init — Initialize with GitHub username
    server.registerTool(
      'init',
      {
        description:
          'Initialize OSS Autopilot with a GitHub username. Creates the state file and sets up initial configuration.',
        inputSchema: {
          username: z.string().describe('Your GitHub username'),
        },
        annotations: { readOnlyHint: false, destructiveHint: false },
      },
      wrapTool(runInit),
    );
  • The `validateGitHubUsername` helper called by `runInit` to validate the username against GitHub's rules (length, characters, no leading/trailing hyphens, no placeholders).
    export function validateGitHubUsername(username: string): string {
      if (!username || username.trim().length === 0) {
        throw new ValidationError('GitHub username cannot be empty.');
      }
    
      const trimmed = username.trim();
    
      if (trimmed.length > MAX_USERNAME_LENGTH) {
        throw new ValidationError(
          `GitHub username must be at most ${MAX_USERNAME_LENGTH} characters (got ${trimmed.length}).`,
        );
      }
    
      if (!USERNAME_CHARS_PATTERN.test(trimmed)) {
        throw new ValidationError('GitHub username can only contain alphanumeric characters and hyphens.');
      }
    
      if (trimmed.startsWith('-')) {
        throw new ValidationError('GitHub username cannot start with a hyphen.');
      }
    
      if (trimmed.endsWith('-')) {
        throw new ValidationError('GitHub username cannot end with a hyphen.');
      }
    
      if (CONSECUTIVE_HYPHENS_PATTERN.test(trimmed)) {
        throw new ValidationError('GitHub username cannot contain consecutive hyphens.');
      }
    
      // Reject the same placeholder strings that pr-monitor's runtime auto-repair
      // catches. Without this guard `init`, `setup --set username=`, and the MCP
      // `config` tool happily persist values like "example-user" copied from
      // documentation, leaving auto-repair to clean up after the next fetch and
      // surfacing a "showing partial data" banner on the dashboard in the meantime.
      if (isPlaceholderUsername(trimmed)) {
        throw new ValidationError(
          `"${trimmed}" looks like a placeholder from documentation, not a real GitHub username. Use your actual GitHub login.`,
        );
      }
    
      return trimmed;
    }
Behavior3/5

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

Annotations (readOnlyHint=false, destructiveHint=false) already indicate a non-read, non-destructive write operation. Description adds that it creates a state file and config, consistent with annotations, but does not detail idempotency or side effects.

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?

Single sentence, front-loaded with key action and inputs, no wasted words.

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

Completeness4/5

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

For a simple init tool with one parameter and no output schema, the description covers the essentials: what it does, what it requires, and what it creates. Minor omission about re-running behavior.

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 100% and description repeats 'GitHub username' from schema, adding no further semantics beyond what the schema provides.

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 what the tool does: initialize OSS Autopilot with a GitHub username, creating state file and config. It distinguishes from siblings by specifying initialization action, though not explicitly contrasting with 'setup'.

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?

Implied usage as a first-step tool, but there is no explicit guidance on when to use or when not to use, nor alternatives mentioned.

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/costajohnt/oss-autopilot'

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