Skip to main content
Glama

affine_current_user

Retrieve details of the currently signed-in user within the AFFiNE MCP Server, facilitating user authentication and session management for workspace operations.

Instructions

Get current signed-in user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the affine_current_user tool. It executes a GraphQL query to fetch the current user's details (id, name, email, etc.) and returns them as text.
    const currentUserHandler = async () => {
      const query = `query Me { currentUser { id name email emailVerified avatarUrl disabled } }`;
      const data = await gql.request<{ currentUser: any }>(query);
      return text(data.currentUser);
    };
  • The input/output schema for the tool, with empty inputSchema indicating no parameters required, title and description provided.
    {
      title: "Current User",
      description: "Get current signed-in user.",
      inputSchema: {}
  • The registration of the "affine_current_user" tool using server.registerTool, linking the schema and handler.
    server.registerTool(
      "affine_current_user",
      {
        title: "Current User",
        description: "Get current signed-in user.",
        inputSchema: {}
      },
      currentUserHandler as any
    );

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/DAWNCR0W/affine-mcp-server'

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