Skip to main content
Glama
TykanN

Swit MCP Server

by TykanN

swit-oauth-start

Initiate OAuth authentication and return a URL to open in a browser for authorizing access to Swit workspaces.

Instructions

Start OAuth authentication. Returns authentication URL that can be opened in browser.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `handleOAuthStart` function that executes the 'swit-oauth-start' tool logic. It checks if OAuth web server is initialized, verifies if already authenticated, then generates an authorization URL and returns instructions for browser-based authentication.
    export const handleOAuthStart = async (oauthWebServer: OAuthWebServer | null) => {
      if (!oauthWebServer) {
        return {
          error:
            'OAuth web server is not initialized. Please check SWIT_CLIENT_ID and SWIT_CLIENT_SECRET environment variables.',
        };
      }
    
      if (oauthWebServer.isAuthenticated()) {
        return {
          error: 'OAuth authentication already completed.',
          note: 'To re-authenticate, please logout first.',
        };
      }
    
      const authUrl = oauthWebServer.getAuthorizationUrl();
      const port = process.env.OAUTH_PORT || '3000';
    
      return {
        authorizationUrl: authUrl,
        webServerUrl: `http://localhost:${port}`,
        instructions: [
          '1. Open the authorizationUrl above in your browser.',
          '2. Login with your Swit account and authorize the application.',
          '3. The token will be automatically saved upon completion.',
          '4. Use swit-oauth-status to check authentication status.',
        ],
      };
    };
  • Empty schema (EmptySchema) used as the input schema for 'swit-oauth-start', meaning the tool accepts no input parameters.
    const EmptySchema = z.object({});
  • Tool definition/registration for 'swit-oauth-start' in the oauthTools array, defining its name, description, and input schema.
    {
      name: 'swit-oauth-start',
      description: 'Start OAuth authentication. Returns authentication URL that can be opened in browser.',
      inputSchema: zodToJsonSchema(EmptySchema),
    },
  • The oauthHandlers record mapping the tool name 'swit-oauth-start' to its handler function `handleOAuthStart`, wired up with the OAuthWebServer dependency.
    export const oauthHandlers = (oauthWebServer: OAuthWebServer | null) => ({
      'swit-oauth-status': () => handleOAuthStatus(oauthWebServer),
      'swit-oauth-start': () => handleOAuthStart(oauthWebServer),
      'swit-oauth-logout': () => handleOAuthLogout(oauthWebServer),
    });
  • src/index.ts:109-109 (registration)
    Final wiring where oauthHandlers are spread into the global toolHandlers record used by the MCP server's CallToolRequestSchema handler.
    toolHandlers = { ...oauthHandlers(oauthWebServer), ...coreHandlers(switClient) };
Behavior3/5

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

With no annotations, the description carries full burden. It discloses the core behavior (returns a URL to open in browser) but does not detail side effects, state changes, or how to handle the returned URL.

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?

A single, front-loaded sentence with no filler. Every word adds value.

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 no parameters and no output schema, the description is adequate but could benefit from notes about the OAuth flow, token handling, or that the URL must be visited to complete authentication.

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?

There are no parameters, so the input schema fully covers them. The description adds no additional parameter meaning, but with zero parameters, baseline is 4.

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 it 'Starts OAuth authentication' and returns an authentication URL. The verb and resource are specific, but it does not explicitly differentiate from siblings like swit-oauth-status or swit-oauth-logout, though the purpose is distinct enough.

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 use when initiating OAuth, but provides no explicit guidance on when to use versus alternatives, no prerequisites, and no 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/TykanN/swit-mcp'

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