Skip to main content
Glama

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], }; } );

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