Skip to main content
Glama

linear_getViewer

Retrieve details of the authenticated user in the Linear project management system, enabling AI assistants to access and manage user-specific data efficiently.

Instructions

Get information about the currently authenticated user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'linear_getViewer' tool. It wraps the call to linearService.getUserInfo() with error handling.
    export function handleGetViewer(linearService: LinearService) { return async (args: unknown) => { try { return await linearService.getUserInfo(); } catch (error) { logError('Error getting viewer information', error); throw error; } }; }
  • The MCPToolDefinition for 'linear_getViewer', including input and output schemas.
    export const getViewerToolDefinition: MCPToolDefinition = { name: 'linear_getViewer', description: 'Get information about the currently authenticated user', input_schema: { type: 'object', properties: {}, }, output_schema: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, email: { type: 'string' }, active: { type: 'boolean' }, displayName: { type: 'string' }, organization: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, }, }, }, }, };
  • Registration of the handler for 'linear_getViewer' within the registerToolHandlers function.
    // User tools linear_getViewer: handleGetViewer(linearService), linear_getOrganization: handleGetOrganization(linearService), linear_getUsers: handleGetUsers(linearService), linear_getLabels: handleGetLabels(linearService),
  • Inclusion of the 'linear_getViewer' tool definition in the allToolDefinitions array used for MCP registration.
    export const allToolDefinitions: MCPToolDefinition[] = [ // User tools getViewerToolDefinition, getOrganizationToolDefinition, getUsersToolDefinition, getLabelsToolDefinition,
  • src/index.ts:44-55 (registration)
    Top-level request handler in MCP server that dynamically registers and dispatches to tool handlers including 'linear_getViewer'.
    handleRequest: async (req: { name: string; args: unknown }) => { const handlers = registerToolHandlers(linearService); const toolName = req.name; if (toolName in handlers) { // Use a type assertion here since we know the tool name is valid const handler = handlers[toolName as keyof typeof handlers]; return await handler(req.args); } else { throw new Error(`Unknown tool: ${toolName}`); } },

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/tacticlaunch/mcp-linear'

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