Skip to main content
Glama

resolve_capability

Resolve a capability URI or natural-language phrase into ranked AI artifacts. This enables runtime selection of the current artifact for a capability.

Instructions

Resolve a capability:// URI or natural-language capability into ranked AI artifacts. This is Unfragile's capability DNS primitive. Use when an agent knows what capability it needs and must choose the safest current artifact at runtime.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
capabilityYesCapability URI or phrase, e.g. 'capability://database.postgres.query.readonly' or 'read-only Postgres database access'
limitNoMax resolutions
typeNoFilter by artifact type
riskNoRisk posture. production/enterprise/strict require stronger quality/status gates.default

Implementation Reference

  • src/index.ts:527-545 (registration)
    Registration of the resolve_capability tool on the MCP server with Zod schema for parameters (capability, limit, type, risk).
    server.tool(
      "resolve_capability",
      "Resolve a capability:// URI or natural-language capability into ranked AI artifacts. This is Unfragile's capability DNS primitive. Use when an agent knows what capability it needs and must choose the safest current artifact at runtime.",
      {
        capability: z.string().min(2).max(500).describe("Capability URI or phrase, e.g. 'capability://database.postgres.query.readonly' or 'read-only Postgres database access'"),
        limit: z.number().min(1).max(20).default(5).describe("Max resolutions"),
        type: z.enum(["agent", "api", "app", "benchmark", "cli", "dataset", "extension", "finetune", "framework", "mcp", "model", "platform", "product", "prompt", "repo", "skill", "template", "webapp", "workflow"]).optional().describe("Filter by artifact type"),
        risk: z.enum(["default", "production", "enterprise", "strict"]).default("default").describe("Risk posture. production/enterprise/strict require stronger quality/status gates."),
      },
      async ({ capability, limit, type, risk }) => {
        log("resolve_capability", capability);
        try {
          const data = await resolveAPI(capability, { limit, type, risk });
          return { content: [{ type: "text" as const, text: formatResolve(data) }] };
        } catch (err) {
          return { content: [{ type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}` }], isError: true };
        }
      }
    );
  • Handler function that logs, calls resolveAPI, and formats the response using formatResolve.
    async ({ capability, limit, type, risk }) => {
      log("resolve_capability", capability);
      try {
        const data = await resolveAPI(capability, { limit, type, risk });
        return { content: [{ type: "text" as const, text: formatResolve(data) }] };
      } catch (err) {
        return { content: [{ type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}` }], isError: true };
      }
    }
  • resolveAPI helper: calls the Unfragile /api/v1/resolve endpoint with capability, limit, type, and risk parameters.
    async function resolveAPI(
      capability: string,
      options: { limit?: number; type?: string; risk?: string; passport?: boolean } = {}
    ): Promise<ResolveResponse> {
      const params = new URLSearchParams({ capability, source: SOURCE });
      if (options.limit) params.set("limit", String(options.limit));
      if (options.type) params.set("type", options.type);
      if (options.risk) params.set("risk", options.risk);
      if (options.passport) params.set("passport", "true");
    
      const headers: Record<string, string> = { Accept: "application/json" };
      if (API_KEY) headers["X-API-Key"] = API_KEY;
    
      const controller = new AbortController();
      const timeout = setTimeout(() => controller.abort(), 15_000);
    
      try {
        const res = await fetch(`${API_BASE}/api/v1/resolve?${params}`, {
          headers,
          signal: controller.signal,
        });
    
        if (!res.ok) {
          const text = await res.text();
          throw new Error(`Unfragile resolver API error ${res.status}: ${text}`);
        }
    
        return res.json() as Promise<ResolveResponse>;
      } finally {
        clearTimeout(timeout);
      }
    }
  • formatResolve helper: formats the ResolveResponse into a human-readable string for the tool output.
    function formatResolve(data: ResolveResponse): string {
      const lines: string[] = [];
      lines.push(`# Resolve: ${data.capability}`);
      lines.push(`Normalized query: ${data.normalizedQuery}`);
      lines.push(`Mode: ${data.resolver.mode} | Risk mode: ${data.resolver.riskMode}`);
    
      if (data.resolutions.length === 0) {
        lines.push("\nNo trusted artifacts resolved for this capability. This is a demand gap.");
        return lines.join("\n");
      }
    
      for (let i = 0; i < data.resolutions.length; i++) {
        const r = data.resolutions[i];
        const verified = r.artifact.verified ? " ✓" : "";
        lines.push(`\n## ${i + 1}. ${r.artifact.name}${verified}`);
        lines.push(`**Type:** ${r.artifact.type} | **Resolver score:** ${r.resolverScore}/100 | **Trust:** ${r.trust.score}/100 | **Risk:** ${r.dataAccessRisk}`);
        lines.push(`**URL:** ${r.artifact.url}`);
        if (r.capabilities.length > 0) {
          lines.push("**Matched capabilities:**");
          for (const cap of r.capabilities.slice(0, 4)) {
            lines.push(`- ${cap.name} (${Math.round(cap.matchScore * 100)}% match)`);
            if (cap.requires.length > 0) lines.push(`  Requires: ${cap.requires.join(", ")}`);
            if (cap.limitations.length > 0) lines.push(`  Limitations: ${cap.limitations.join(", ")}`);
          }
        }
        if (r.trust.observedMatches > 0) {
          lines.push(`Observed outcomes: ${r.trust.observedMatches} matches, ${Math.round(r.trust.successRate * 100)}% success`);
        }
        lines.push(`Passport: ${r.artifact.passportUrl}`);
      }
    
      return lines.join("\n");
    }
  • TypeScript interface ResolveResponse defining the structure returned by the resolve API (capability, resolver, resolutions with artifact, trust, capabilities).
    interface ResolveResponse {
      capability: string;
      normalizedQuery: string;
      resolver: {
        id: string;
        mode: string;
        riskMode: string;
        gapDetected: boolean;
      };
      resolutions: Array<{
        artifact: {
          slug: string;
          name: string;
          type: string;
          url: string;
          pageUrl: string;
          passportUrl: string;
          verified: boolean;
          status: string;
          unfragileRank: number;
        };
        resolverScore: number;
        dataAccessRisk: "low" | "moderate" | "high";
        capabilities: Array<{
          name: string;
          matchScore: number;
          limitations: string[];
          requires: string[];
        }>;
        trust: {
          score: number;
          verified: boolean;
          observedMatches: number;
          successRate: number;
          topIntents: string[];
        };
      }>;
      _links: Record<string, string>;
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It mentions 'resolves into ranked AI artifacts' and 'safest current artifact,' but lacks details on ranking criteria, safety checks, or whether the operation is read-only. Adequate but could be richer.

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?

Two concise sentences, no wasted words. The first sentence defines the primary action, the second provides usage context. Highly efficient.

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

Completeness3/5

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

No output schema is provided, and the description omits details about the return format, ranking logic, or result structure. While the tool's DNS-like nature might justify brevity, additional context on what artifacts are returned would improve completeness.

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

Parameters4/5

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

Schema coverage is 100%, and the description adds value by clarifying the capability URI format with an example and explaining the risk parameter's quality gates. This enhances understanding beyond the schema alone.

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 clearly states the tool resolves capability:// URIs or natural language into ranked AI artifacts, positioning it as Unfragile's capability DNS primitive. This distinctively differentiates it from sibling tools like search or find_mcps, which focus on discovery.

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

Usage Guidelines4/5

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

The description explicitly says 'Use when an agent knows what capability it needs and must choose the safest current artifact at runtime.' This is clear guidance, though it could mention alternatives like find_mcps for broader discovery.

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/Savirinc/unfragile-mcp-server'

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