Skip to main content
Glama

list_accounts

Retrieve all signed-in Microsoft accounts using the MCP server, enabling AI assistants to interact with Microsoft services via natural language commands.

Instructions

List all signed-in Microsoft accounts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for list_accounts, decorated with @mcp.tool. It lists all signed-in Microsoft accounts by calling the auth.list_accounts() helper and formatting the results as a list of dicts with username and account_id.
    @mcp.tool
    def list_accounts() -> list[dict[str, str]]:
        """List all signed-in Microsoft accounts"""
        return [
            {"username": acc.username, "account_id": acc.account_id}
            for acc in auth.list_accounts()
        ]
  • Supporting helper function that retrieves accounts from the MSAL PublicClientApplication's token cache and returns them as a list of Account namedtuples (username and account_id). Used by the list_accounts tool handler.
    def list_accounts() -> list[Account]:
        app = get_app()
        return [
            Account(username=a["username"], account_id=a["home_account_id"])
            for a in app.get_accounts()
        ]
  • Import of mcp from tools.py in server.py, which registers all @mcp.tool decorated functions when the module is imported before mcp.run() is called.
    from .tools import mcp
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 of behavioral disclosure. It states the tool lists accounts but doesn't describe what 'signed-in' means operationally, whether it returns active sessions or stored credentials, the format of the output, or any limitations (e.g., rate limits, permissions required). For a 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 a single, clear sentence that efficiently conveys the core functionality without any fluff. It's front-loaded with the essential action and resource, making it easy to parse. Every word earns its place, and there's no wasted verbiage or redundancy.

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 simplicity (0 parameters, no output schema, no annotations), the description is adequate but minimal. It covers the basic purpose but lacks details on behavior, output format, or usage context, which could be important for an AI agent to invoke it correctly. Without annotations or output schema, more elaboration on what 'list' entails would improve completeness.

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 tool has 0 parameters, and schema description coverage is 100%, so there's no need for parameter documentation in the description. The description appropriately doesn't discuss parameters, focusing instead on the tool's purpose. This meets the baseline of 4 for zero-parameter tools, as it avoids unnecessary details.

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 action ('List') and resource ('all signed-in Microsoft accounts'), making the tool's purpose immediately understandable. It distinguishes from siblings like 'authenticate_account' or 'get_contact' by focusing on listing accounts rather than authentication or specific resource retrieval. However, it doesn't explicitly differentiate from other list tools like 'list_contacts' or 'list_emails' beyond the resource type.

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. It doesn't mention prerequisites (e.g., whether authentication is required), use cases (e.g., checking available accounts before operations), or exclusions (e.g., not for listing non-signed-in accounts). With siblings like 'authenticate_account' and 'check_availability', some context on sequencing would be helpful but is absent.

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

Related 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/elyxlz/microsoft-mcp'

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