Skip to main content
Glama

list_relationships

Retrieve all connections for an idea, showing both incoming and outgoing relationships to understand its context within the idea management system.

Instructions

Get all relationships for an idea (both as source and target).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ideaIdYesThe ID of the idea to get relationships for

Implementation Reference

  • The handleProxyTool function acts as a generic handler for all tools defined in proxyTools, including list_relationships. It forwards the tool call to the main application's MCP handler via idealiftClient.mcpProxy.
    export async function handleProxyTool(
      toolName: string,
      args: Record<string, unknown>,
      chatgptSubjectId: string
    ): Promise<{ content: Array<{ type: string; text: string }>; isError: boolean }> {
      try {
        const response = await idealiftClient.mcpProxy(
          chatgptSubjectId,
          'tools/call',
          { name: toolName, arguments: args }
        );
    
        if (response.error) {
          return {
            content: [{ type: 'text', text: `Error: ${response.error.message}` }],
            isError: true,
          };
        }
    
        // The result from handleJsonRpcRequest for tools/call is { content: [...], isError?: boolean }
        const result = response.result as { content?: Array<{ type: string; text: string }>; isError?: boolean } | undefined;
    
        if (result?.content) {
          return {
            content: result.content,
            isError: result.isError || false,
          };
        }
    
        // Fallback: wrap the result as text
        return {
          content: [{ type: 'text', text: JSON.stringify(response.result, null, 2) }],
          isError: false,
        };
      } catch (error) {
        console.error(`[ProxyTool] Error calling ${toolName}:`, error);
        return {
          content: [{ type: 'text', text: `Proxy error: ${(error as Error).message}` }],
          isError: true,
        };
      }
    }
  • Registration of the list_relationships tool definition within the proxyTools array.
    {
      name: 'list_relationships',
      description: 'Get all relationships for an idea (both as source and target).',
      inputSchema: {
        type: 'object' as const,
        properties: {
          ideaId: { type: 'string', description: 'The ID of the idea to get relationships for' },
        },
        required: ['ideaId'],
      },
      annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },
      _meta: { 'openai/visibility': 'public' },
    },

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/Startvest-LLC/idealift-mcp-server'

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