Skip to main content
Glama
badchars

osint-mcp-server

by badchars

m365_tenant

Discover Microsoft 365 tenant information including tenant ID, region, and OpenID configuration endpoints for a specified domain.

Instructions

Discover Microsoft 365 tenant information for a domain. Returns tenant ID, region, and OpenID configuration endpoints.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain to check for M365 tenant

Implementation Reference

  • The m365Tenant function performs the core logic for the 'm365_tenant' tool by fetching OpenID configuration from Microsoft's servers.
    export async function m365Tenant(domain: string): Promise<M365TenantResult> {
      try {
        const res = await fetch(
          `https://login.microsoftonline.com/${encodeURIComponent(domain)}/v2.0/.well-known/openid-configuration`,
        );
        if (!res.ok) return { domain, found: false };
    
        const data = await res.json();
        const issuer: string = data.issuer ?? "";
    
        // Extract tenant ID from issuer URL: https://login.microsoftonline.com/{tenant-id}/v2.0
        const tenantMatch = issuer.match(/\/([0-9a-f-]{36})\//);
        const tenantId = tenantMatch?.[1];
    
        // Extract region from tenant_region_scope
        const region = data.tenant_region_scope;
    
        return {
          domain,
          found: true,
          tenantId,
          issuer,
          authorizationEndpoint: data.authorization_endpoint,
          tokenEndpoint: data.token_endpoint,
          region,
        };
      } catch {
        return { domain, found: false };
      }
    }
  • The M365TenantResult interface defines the output structure for the 'm365_tenant' tool.
    interface M365TenantResult {
      domain: string;
      found: boolean;
      tenantId?: string;
      issuer?: string;
      authorizationEndpoint?: string;
      tokenEndpoint?: string;
      region?: string;
    }
  • The 'm365_tenant' tool is registered in src/protocol/tools.ts, mapping the name and schema to the implementation.
    const m365TenantTool: ToolDef = {
      name: "m365_tenant",
      description: "Discover Microsoft 365 tenant information for a domain. Returns tenant ID, region, and OpenID configuration endpoints.",
      schema: {
        domain: z.string().describe("Domain to check for M365 tenant"),
      },
      execute: async (args) => json(await m365Tenant(args.domain as string)),
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return data structure but omits critical operational details: whether this requires authentication, rate limits, network dependencies, error conditions, or if it performs external lookups. For a tool that likely queries Microsoft services, this transparency gap is significant.

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 front-loads the core purpose and immediately specifies the return values. Every word earns its place with zero redundancy or fluff, making it optimally scannable for an AI agent.

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 moderate complexity (external service query), lack of annotations, and no output schema, the description is minimally adequate. It covers the purpose and output structure but misses behavioral context (auth, errors, limits). For a standalone tool with no structured safety hints, this leaves the agent under-informed about operational risks.

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?

The input schema has 100% description coverage, fully documenting the single 'domain' parameter. The description adds no additional parameter semantics beyond what the schema provides (e.g., format examples, validation rules, or domain-specific constraints). This meets the baseline for high schema coverage.

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 specific action ('Discover'), resource ('Microsoft 365 tenant information for a domain'), and output details ('tenant ID, region, and OpenID configuration endpoints'). It distinguishes itself from sibling tools like 'm365_userrealm' by focusing on tenant-level discovery rather than user authentication realm details.

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 like 'm365_userrealm' or other domain investigation tools (e.g., 'whois_domain', 'vt_domain'). It lacks explicit when/when-not instructions or prerequisite context, leaving usage decisions entirely to the agent's inference.

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/badchars/osint-mcp-server'

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