Skip to main content
Glama

parse-teams-url

Read-only

Convert any Microsoft Teams meeting URL format (short, full, or recap) into a standard joinWebUrl for consistent access.

Instructions

Converts any Teams meeting URL format (short /meet/, full /meetup-join/, or recap ?threadId=) into a standard joinWebUrl. Use this before list-online-meetings when the user provides a recap or short URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesTeams meeting URL in any format

Implementation Reference

  • The execute handler for parse-teams-url that validates the url parameter, calls parseTeamsUrl(), and returns the joinWebUrl or an error.
    execute: async (params) => {
      const url = params.url;
      if (typeof url !== 'string') {
        return {
          content: [{ type: 'text', text: JSON.stringify({ error: 'url is required.' }) }],
          isError: true,
        };
      }
      try {
        const joinWebUrl = parseTeamsUrl(url);
        return { content: [{ type: 'text', text: joinWebUrl }] };
      } catch (error) {
        return {
          content: [{ type: 'text', text: JSON.stringify({ error: (error as Error).message }) }],
          isError: true,
        };
      }
    },
  • The core parsing function that converts any Teams meeting URL format (short /meet/, full /meetup-join/, or recap ?threadId=) into a standard joinWebUrl.
    export function parseTeamsUrl(url: string): string {
      // Format 1 & 2: Already a joinWebUrl or short /meet/ URL — pass through
      if (url.includes('/meet/') || url.includes('/meetup-join/')) {
        return url;
      }
    
      // Format 3: Recap URL — extract params and reconstruct joinWebUrl
      if (url.toLowerCase().includes('meetingrecap')) {
        const params = Object.fromEntries(
          [...url.matchAll(/([a-zA-Z]+)=([^&#]+)/g)].map((m) => [m[1], m[2]])
        );
        const threadId = decodeURIComponent(params.threadId || '');
        const tenantId = params.tenantId || '';
        const organizerId = params.organizerId || '';
    
        if (!threadId || !tenantId || !organizerId) {
          throw new Error('Invalid recap URL: missing threadId, tenantId, or organizerId parameter');
        }
    
        const threadEnc = encodeURIComponent(threadId).replace(/%3A/gi, '%3a').replace(/%40/gi, '%40');
        const ctx = JSON.stringify({ Tid: tenantId, Oid: organizerId });
        const ctxEnc = encodeURIComponent(ctx);
    
        return `https://teams.microsoft.com/l/meetup-join/${threadEnc}/0?context=${ctxEnc}`;
      }
    
      // Unknown format — return as-is
      return url;
    }
  • The Zod schema for parse-teams-url: expects a single 'url' string parameter.
    buildSchema: () => ({
      url: z.string().describe('Teams meeting URL in any format'),
    }),
  • The registerUtilityToolWithMcp function that calls server.tool() to register utility tools (including parse-teams-url) with the MCP server.
    function registerUtilityToolWithMcp(
      server: McpServer,
      utility: UtilityTool,
      ctx: UtilityToolContext
    ): void {
      server.tool(
        utility.name,
        utility.description,
        utility.buildSchema(ctx),
        {
          title: utility.name,
          readOnlyHint: utility.readOnlyHint ?? true,
          openWorldHint: utility.openWorldHint ?? true,
        },
        async (params) => utility.execute(params, ctx)
      );
    }
  • The UTILITY_TOOLS array registration entry listing parse-teams-url with its name, method, path, description, schema, and execute handler.
    export const UTILITY_TOOLS: readonly UtilityTool[] = [
      {
        name: 'parse-teams-url',
        method: 'POST',
        path: 'tool:parse-teams-url',
        description:
          'Converts any Teams meeting URL format (short /meet/, full /meetup-join/, or recap ?threadId=) into a standard joinWebUrl. Use this before list-online-meetings when the user provides a recap or short URL.',
Behavior3/5

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

The annotations already declare readOnlyHint=true, indicating a safe read operation. The description adds no additional behavioral details such as error handling or return format, beyond the basic conversion action.

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 consists of two concise sentences: the first defines the core functionality, and the second provides usage guidance. No unnecessary words or redundancy.

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 conversion tool with one parameter and no output schema, the description covers purpose, input formats, and usage context. While it does not explicitly state the return value, it is implied, and the guidance ties it to a related tool.

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?

With 100% schema description coverage, the baseline is 3. The description enriches the single 'url' parameter by detailing the three accepted formats (short, full, recap), providing context beyond the schema's 'any format'.

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

Purpose5/5

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

The description clearly states the tool converts various Teams meeting URL formats into a standard joinWebUrl, specifying three distinct formats (short /meet/, full /meetup-join/, recap ?threadId=). This provides a specific verb+resource pair and distinguishes the action from other tools.

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

Usage Guidelines4/5

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

The description explicitly advises to 'use this before list-online-meetings when the user provides a recap or short URL', giving clear context for when to apply the tool. However, it does not mention when not to use it or list alternative approaches.

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/Softeria/ms-365-mcp-server'

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