Skip to main content
Glama
TykanN

Swit MCP Server

by TykanN

swit-oauth-start

Initiate OAuth authentication to access Swit collaboration tools by generating a browser-ready authentication URL.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that implements the logic for the 'swit-oauth-start' tool. It checks if OAuth is initialized and not already authenticated, then generates an authorization URL, web server URL, and provides step-by-step instructions.
    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.',
        ],
      };
    };
  • Defines the tool schema including name, description, and empty input schema (no parameters required).
    {
      name: 'swit-oauth-start',
      description: 'Start OAuth authentication. Returns authentication URL that can be opened in browser.',
      inputSchema: zodToJsonSchema(EmptySchema),
    },
  • Registers the 'swit-oauth-start' tool handler by mapping the tool name to the handleOAuthStart function.
    export const oauthHandlers = (oauthWebServer: OAuthWebServer | null) => ({
      'swit-oauth-status': () => handleOAuthStatus(oauthWebServer),
      'swit-oauth-start': () => handleOAuthStart(oauthWebServer),
      'swit-oauth-logout': () => handleOAuthLogout(oauthWebServer),
    });
  • src/index.ts:61-63 (registration)
    Registers the tool list handler which includes 'swit-oauth-start' from oauthTools for the MCP ListTools request.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: [...oauthTools, ...coreTools] };
    });
  • src/index.ts:109-109 (registration)
    Dynamically sets up the toolHandlers object which includes the 'swit-oauth-start' handler from oauthHandlers for tool execution.
    toolHandlers = { ...oauthHandlers(oauthWebServer), ...coreHandlers(switClient) };
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. It discloses that the tool returns an authentication URL for browser use, which is useful behavioral context. However, it misses critical details: whether this requires user interaction, if it initiates a server-side or client-side flow, potential rate limits, error conditions, or what happens after the URL is opened. For an authentication tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 two short sentences that are front-loaded with the core purpose ('Start OAuth authentication') followed by the key outcome ('Returns authentication URL that can be opened in browser'). Every word earns its place with no redundancy or fluff, making it highly concise and well-structured for quick understanding.

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 complexity (authentication initiation) and lack of annotations or output schema, the description is minimally adequate. It covers the basic action and return value, but for a security-sensitive OAuth tool, it should ideally mention more about the flow (e.g., redirect URIs, scopes, or state parameters) or error handling. Without output schema, the description doesn't explain return values beyond the URL, leaving some context gaps.

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 input schema has 0 parameters with 100% coverage, so no parameters need documentation. The description appropriately doesn't discuss parameters, which is efficient. According to the rules, 0 parameters warrants a baseline score of 4, as there's nothing to compensate for and the description doesn't add unnecessary param info.

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: 'Start OAuth authentication' specifies the action (starting) and resource (OAuth authentication). It distinguishes from siblings like 'swit-oauth-logout' and 'swit-oauth-status' by focusing on initiation rather than termination or status checking. However, it doesn't explicitly differentiate from non-OAuth siblings, keeping it at a 4 rather than a 5.

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 'Returns authentication URL that can be opened in browser,' suggesting this tool is used when an OAuth flow needs to be initiated. However, it lacks explicit guidance on when to use this vs. alternatives like 'swit-oauth-status' (e.g., for checking current auth state) or prerequisites (e.g., needing user interaction). This is typical implied usage without clear exclusions or comparisons.

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