Skip to main content
Glama
ref-tools

Widget MCP

by ref-tools

Display Fact

display-fact

Quickly present concise factual answers in LLM chats using this tool. Input a description and a short fact to display clear, accurate information in a widget format.

Instructions

Display a simple fact. Should be used when answering a users question that has a short factual answer. You don't need to say anything else after answering with this tool. Example: { description: 'The capital of France', fact: 'Paris' }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYesA description of the fact
factYesThe fact to display. Should be short and concise.

Implementation Reference

  • index.ts:72-83 (handler)
    Handler function for the "display-fact" tool that creates and returns a UI resource displaying the provided fact and description using a templated HTML file.
    async ({ description, fact }) => {
      const factResource = createTemplatedUIResource(
        createUIResource,
        "ui://widget/display-fact",
        display_factHtml,
        { description, fact }
      );
    
      return {
        content: [factResource],
      };
    }
  • Input schema using Zod for the "display-fact" tool, defining required string parameters: description and fact.
    inputSchema: {
      description: z.string().describe("A description of the fact"),
      fact: z.string().describe("The fact to display. Should be short and concise."),
    },
  • index.ts:62-84 (registration)
    Registration of the "display-fact" MCP tool with title, description, input schema, and handler function.
      "display-fact",
      {
        title: "Display Fact",
        description:
          "Display a simple fact. Should be used when answering a users question that has a short factual answer. You don't need to say anything else after answering with this tool. Example: { description: 'The capital of France', fact: 'Paris' }",
        inputSchema: {
          description: z.string().describe("A description of the fact"),
          fact: z.string().describe("The fact to display. Should be short and concise."),
        },
      },
      async ({ description, fact }) => {
        const factResource = createTemplatedUIResource(
          createUIResource,
          "ui://widget/display-fact",
          display_factHtml,
          { description, fact }
        );
    
        return {
          content: [factResource],
        };
      }
    );
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it displays facts, requires no additional output from the agent, and handles short factual answers. However, it doesn't mention potential limitations like character limits or formatting constraints.

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 perfectly concise and front-loaded: the first sentence states the purpose, the second provides usage guidelines, and the third gives a concrete example. Every sentence earns its place with no wasted words.

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 simplicity (2 parameters, no output schema, no annotations), the description is nearly complete. It covers purpose, usage, and provides an example. The only minor gap is the lack of explicit mention about what happens after tool invocation (though 'You don't need to say anything else' implies the tool handles output).

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%, so the schema already documents both parameters thoroughly. The description adds minimal value beyond the schema by providing an example that illustrates parameter usage, but doesn't explain semantics beyond what's in the schema descriptions.

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's purpose with specific verbs ('Display a simple fact') and resource ('fact'), and distinguishes it from siblings by specifying its use case for short factual answers. It provides a concrete example that reinforces the purpose.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('when answering a users question that has a short factual answer') and provides clear exclusion guidance ('You don't need to say anything else after answering with this tool'). This differentiates it from other tools like conversion, stopwatch, and timer.

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

Related 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/ref-tools/widget-mcp'

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