Skip to main content
Glama
DriftOS

DriftOS MCP Server

Official
by DriftOS

driftos_get_facts

Retrieve extracted facts from a specific conversation branch in DriftOS MCP Server to access structured information for semantic routing.

Instructions

Get extracted facts from a specific branch.

Args:

  • branch_id (string): The branch ID to get facts for

Returns: [{ "key": string, "value": string, "confidence": number }]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branch_idYesBranch ID to get facts for

Implementation Reference

  • Executes the tool logic by calling driftClient.getFacts with the branch_id parameter, formats the result as JSON text in MCP response format, and handles errors by returning an error message.
    async (params) => {
      try {
        const result = await driftClient.getFacts(params.branch_id);
    
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        const message = error instanceof Error ? error.message : 'Unknown error';
        return {
          content: [
            {
              type: 'text' as const,
              text: `Error getting facts: ${message}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Zod input schema validating the branch_id parameter as a non-empty string.
    inputSchema: z.object({
      branch_id: z.string().min(1).describe('Branch ID to get facts for'),
    }).strict(),
  • Registers the 'driftos_get_facts' tool on the MCP server with its schema, annotations, and handler function.
      server.registerTool(
        'driftos_get_facts',
        {
          title: 'Get Branch Facts',
          description: `Get extracted facts from a specific branch.
    
    Args:
      - branch_id (string): The branch ID to get facts for
    
    Returns:
      [{ "key": string, "value": string, "confidence": number }]`,
          inputSchema: z.object({
            branch_id: z.string().min(1).describe('Branch ID to get facts for'),
          }).strict(),
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false,
          },
        },
        async (params) => {
          try {
            const result = await driftClient.getFacts(params.branch_id);
    
            return {
              content: [
                {
                  type: 'text' as const,
                  text: JSON.stringify(result, null, 2),
                },
              ],
            };
          } catch (error) {
            const message = error instanceof Error ? error.message : 'Unknown error';
            return {
              content: [
                {
                  type: 'text' as const,
                  text: `Error getting facts: ${message}`,
                },
              ],
              isError: true,
            };
          }
        }
      );

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/DriftOS/driftos-mcp-server'

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