Skip to main content
Glama
compass-food

Compass DaaS

Official

Decide restaurant fit

compass_decide_fit
Read-onlyIdempotent

Evaluate whether a restaurant fits a user's dietary profile. Returns fit, not fit, or unknown with reason codes, evidence, and user-friendly wording.

Instructions

Conservative fit decision for a restaurant against a user dietary profile. Returns "fit", "not_fit", or "unknown" with reason codes, evidence, and user wording. Returns "unknown" rather than overclaiming.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
compass_idYesCompass restaurant ID, obtained from compass_search or compass_enrich_restaurant
user_profileYesRequired dietary profile for the restaurant fit decision
modeNoResponse detail mode; rich includes fuller evidence and reasoningrich

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
compass_idYesStable Compass restaurant ID
decisionYesConservative decision for the submitted profile
confidenceYesDecision confidence
reason_codesYesCompass public reason codes explaining the decision
evidenceYesEvidence supporting the decision
source_freshnessNoAge and refresh guidance for the evidence behind a result
risk_flagsNoRisk flags that should be surfaced to the user
recommended_user_textNoConservative user-facing wording
verification_requiredNoTrue when the user should verify with the restaurant before relying on the result
last_evaluated_atNoWhen Compass last evaluated this restaurant for decision freshness

Implementation Reference

  • Defines the decideFitTool object with the handler function that parses input via DecideFitInputSchema, calls client.decideFit(), and returns a ToolResult via handleTool.
    import type { CompassClient } from "../client.js";
    import {
      DecideFitInputSchema,
      type DecideFitInput,
      decideFitInputJsonSchema,
    } from "../schemas/input.js";
    import { decideFitOutputJsonSchema } from "../schemas/output.js";
    import { handleTool, readOnlyToolAnnotations, type ToolDefinition, type ToolResult } from "./types.js";
    
    export interface DecideFitClient {
      decideFit(body: unknown, options?: { mode?: "fast" | "rich" }): Promise<unknown>;
    }
    
    export const decideFitTool = {
      definition: {
        name: "compass_decide_fit",
        title: "Decide restaurant fit",
        description:
          'Conservative fit decision for a restaurant against a user dietary profile. Returns "fit", "not_fit", or "unknown" with reason codes, evidence, and user wording. Returns "unknown" rather than overclaiming.',
        inputSchema: decideFitInputJsonSchema,
        outputSchema: decideFitOutputJsonSchema,
        annotations: readOnlyToolAnnotations("Decide restaurant fit"),
      } satisfies ToolDefinition,
    
      handler(client: CompassClient | DecideFitClient, args: unknown): Promise<ToolResult> {
        return handleTool<DecideFitInput>(
          () => DecideFitInputSchema.parse(args),
          ({ mode, ...body }) => client.decideFit(body, { mode }),
        );
      },
    };
  • Zod schema DecideFitInputSchema: validates input with compass_id, user_profile (diet, allergens, exclude_cross_contamination, dietary_rules), and mode.
    export const DecideFitInputSchema = z
      .object({
        compass_id: BoundedTextSchema.describe("Compass restaurant ID, obtained from compass_search or compass_enrich_restaurant"),
        user_profile: UserProfileSchema.extend({
          diet: DietSchema,
          exclude_cross_contamination: z.boolean().default(true),
        }).strict(),
        mode: ModeSchema,
      })
      .strict();
  • JSON schema decideFitInputJsonSchema: the structured JSON input schema used by the MCP tool definition for compass_decide_fit.
    export const decideFitInputJsonSchema = {
      type: "object",
      properties: {
        compass_id: {
          type: "string",
          minLength: 1,
          description: "Compass restaurant ID, obtained from compass_search or compass_enrich_restaurant",
        },
        user_profile: {
          type: "object",
          description: "Required dietary profile for the restaurant fit decision",
          properties: {
            diet: {
              type: "string",
              enum: COMPASS_DIETS,
              description:
                "Preference input. Safety-sensitive and religious-diet values are conservative signals, not public certification/free-from restaurant facts.",
            },
            allergens: {
              type: "array",
              description: "Allergens or ingredients the user wants to avoid; handled conservatively as user preferences",
              items: { type: "string", minLength: 1, maxLength: PROFILE_ITEM_MAX },
              maxItems: PROFILE_LIST_MAX,
            },
            exclude_cross_contamination: {
              type: "boolean",
              default: true,
              description: "When true, treat unknown or shared-prep cross-contamination evidence conservatively",
            },
            dietary_rules: {
              type: "array",
              description: "Additional short user dietary rules or avoidances",
              items: { type: "string", minLength: 1, maxLength: PROFILE_ITEM_MAX },
              maxItems: PROFILE_LIST_MAX,
            },
          },
          required: ["diet"],
          additionalProperties: false,
        },
        mode: {
          type: "string",
          enum: ["fast", "rich"],
          default: "rich",
          description: "Response detail mode; rich includes fuller evidence and reasoning",
        },
      },
      required: ["compass_id", "user_profile"],
      additionalProperties: false,
    } as const;
  • JSON schema decideFitOutputJsonSchema: defines the output shape for the compass_decide_fit tool (compass_id, decision, confidence, reason_codes, evidence, etc.).
    export const decideFitOutputJsonSchema = {
      type: "object",
      description: "Compass conservative restaurant dietary fit decision",
      properties: {
        compass_id: { type: "string", description: "Stable Compass restaurant ID" },
        decision: {
          type: "string",
          enum: COMPASS_DECISIONS,
          description: "Conservative decision for the submitted profile",
        },
        confidence: { type: "string", enum: COMPASS_CONFIDENCES, description: "Decision confidence" },
        reason_codes: {
          type: "array",
          description: "Compass public reason codes explaining the decision",
          items: { type: "string" },
        },
        evidence: { type: "array", description: "Evidence supporting the decision", items: evidenceJsonSchema },
        source_freshness: sourceFreshnessJsonSchema,
        risk_flags: {
          type: "array",
          description: "Risk flags that should be surfaced to the user",
          items: { type: "string", enum: COMPASS_RISK_FLAGS },
        },
        recommended_user_text: { type: "string", description: "Conservative user-facing wording" },
        verification_required: {
          type: "boolean",
          description: "True when the user should verify with the restaurant before relying on the result",
        },
        last_evaluated_at: {
          type: ["string", "null"],
          description: "When Compass last evaluated this restaurant for decision freshness",
        },
      },
      required: ["compass_id", "decision", "confidence", "reason_codes", "evidence"],
      additionalProperties: true,
    } as const;
  • src/index.ts:48-49 (registration)
    Registers the compass_decide_fit tool in the MCP server's CallToolRequestSchema handler, routing calls to decideFitTool.handler(client, args).
    case "compass_decide_fit":
      return decideFitTool.handler(client, request.params.arguments);
Behavior4/5

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

Annotations declare readOnlyHint, idempotentHint, and openWorldHint, which the description does not contradict. The description adds valuable behavioral context: it is 'conservative' and returns 'unknown' rather than overclaiming, which goes beyond the annotations by clarifying the decision philosophy.

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

Conciseness5/5

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

The description is two sentences long, front-loads the key action and outputs, and contains no wasted words. Every sentence contributes essential information.

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 complexity (3 parameters with a nested object, annotations, output schema), the description adequately covers the core behavior. It explains the conservative nature and the three possible outcomes. Missing details like what 'reason codes' and 'evidence' entail are likely covered by the output schema, so the description is largely complete.

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?

The input schema description coverage is 100%, so the schema already documents all parameters. The description adds high-level behavioral context (conservatism, 'unknown' return) but no additional parameter-specific meaning beyond what the schema provides. Baseline 3 is appropriate.

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

Purpose5/5

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

The description uses the specific verb 'decide' and resource 'restaurant fit', and clearly states it returns 'fit', 'not_fit', or 'unknown' with additional artifacts. It distinguishes itself from the sibling tools (compass_search finds restaurants, compass_enrich_restaurant enriches data) by focusing on the fit decision.

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

Usage Guidelines3/5

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

The description implies a conservative decision approach and warns against overclaiming, but does not explicitly state when to use this tool versus its siblings or any prerequisites. It lacks explicit context on when not to use it, leaving the agent to infer from the purpose.

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/compass-food/compass-mcp'

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