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
| Name | Required | Description | Default |
|---|---|---|---|
| branch_id | Yes | Branch ID to get facts for |
Implementation Reference
- src/tools/facts.ts:27-51 (handler)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, }; } }
- src/tools/facts.ts:17-19 (schema)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(),
- src/tools/facts.ts:6-52 (registration)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, }; } } );