Skip to main content
Glama

linear_get_viewer

Retrieve authenticated user information from Linear's issue tracking system to identify the current user account and access permissions.

Instructions

Get information about the authenticated user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that retrieves the authenticated Linear user (viewer) information using linearClient.viewer, extracts relevant fields, and returns it as JSON string in the tool response format. Handles errors appropriately.
    export const linearGetViewerHandler: ToolHandler = async () => { try { // Get the authenticated user (viewer) const viewer = await linearClient.viewer; if (!viewer) { return { content: [ { type: 'text', text: 'Error: Failed to get authenticated user', }, ], isError: true, }; } // Extract user data const userData = { id: await viewer.id, name: await viewer.name, displayName: await viewer.displayName, email: await viewer.email, active: await viewer.active, admin: await viewer.admin, avatarUrl: await viewer.avatarUrl, url: await viewer.url, }; return { content: [ { type: 'text', text: JSON.stringify(userData), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : typeof error === 'string' ? error : 'Unknown error occurred'; return { content: [ { type: 'text', text: `Error: ${errorMessage}`, }, ], isError: true, }; } };
  • Registers the 'linear_get_viewer' tool using registerTool, providing name, description, empty input schema (no parameters needed), and links to the linearGetViewerHandler.
    export const linearGetViewerTool = registerTool( { name: 'linear_get_viewer', description: 'Get information about the authenticated user', inputSchema: { type: 'object', properties: {}, }, }, linearGetViewerHandler );
  • Input schema for the tool: an empty object schema since the tool takes no input parameters.
    inputSchema: { type: 'object', properties: {}, },

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/magarcia/mcp-server-linearapp'

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