Skip to main content
Glama
DriftOS

DriftOS MCP Server

Official
by DriftOS

Get Branch Facts

driftos_get_facts
Read-onlyIdempotent

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,
            };
          }
        }
      );
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare this as read-only, non-destructive, idempotent, and closed-world, covering key behavioral traits. The description adds minimal context beyond this, specifying it retrieves 'extracted facts' and the return format, but doesn't mention aspects like rate limits, authentication needs, or what 'extracted facts' entail. With annotations providing safety profile, a baseline 3 is appropriate as the description adds some value but not rich behavioral details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the core purpose stated first. The Args and Returns sections are structured but could be more concise; for example, the return format is detailed but might be redundant if an output schema existed. Overall, it's efficient with minimal waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no output schema), annotations provide rich safety context, and the description covers the purpose and return format adequately. It doesn't explain sibling differentiation or usage guidelines, but for a simple read operation, it's mostly complete. The lack of output schema means the return description adds necessary value.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'branch_id' fully documented in the schema. The description adds no additional meaning beyond what the schema provides (e.g., no examples, constraints, or context about branch IDs). According to the rules, with high schema coverage, the baseline is 3 even without param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get extracted facts') and target resource ('from a specific branch'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'driftos_get_context' or 'driftos_extract_facts', which might also involve facts or branch data, so it doesn't achieve full sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'driftos_get_context' (which might provide broader context) or 'driftos_extract_facts' (which might create facts), leaving the agent without explicit usage context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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