Skip to main content
Glama
soriat

MCP Elicitations Demo Server

by soriat

getResourceLinks

Generate resource links for multiple resource types by specifying the desired count (1-10) using a tool designed for dynamic user input within the MCP Elicitations Demo Server.

Instructions

Returns multiple resource links that reference different types of resources

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoNumber of resource links to return (1-10)

Implementation Reference

  • The main handler function for the getResourceLinks tool. It parses the count parameter, generates resources using generateAllResources(), constructs a content array with an introductory text block and resource_link blocks for the specified number of resources, and returns it.
    handler: async (args: any) => {
      const { count } = GetResourceLinksSchema.parse(args);
      const content: any[] = [];
    
      // Add intro text
      content.push({
        type: "text" as const,
        text: `Here are ${count} resource links to resources available in this server (see full output in tool response if your client does not support resource_link yet):`,
      });
    
      // Return resource links to actual resources from ALL_RESOURCES
      const ALL_RESOURCES = generateAllResources();
      const actualCount = Math.min(count, ALL_RESOURCES.length);
      for (let i = 0; i < actualCount; i++) {
        const resource = ALL_RESOURCES[i];
        content.push({
          type: "resource_link" as const,
          uri: resource.uri,
          name: resource.name,
          description: `Resource ${i + 1}: ${
            resource.mimeType === "text/plain"
              ? "plaintext resource"
              : "binary blob resource"
          }`,
          mimeType: resource.mimeType,
        });
      }
    
      return { content };
    },
  • Zod schema defining the input for getResourceLinks: optional count (number, 1-10, default 3). Used for inputSchema and parsing args.
    const GetResourceLinksSchema = z.object({
      count: z
        .number()
        .min(1)
        .max(10)
        .default(3)
        .describe("Number of resource links to return (1-10)"),
    });
  • Registration of getResourceLinksTool in the allTools array (line 36), which is used by getTools() to list tools and getToolHandler() to dispatch calls.
    const allTools = [
      echoTool,
      addTool,
      longRunningOperationTool,
      printEnvTool,
      sampleLlmTool,
      sampleWithPreferencesTool,
      sampleMultimodalTool,
      sampleConversationTool,
      sampleAdvancedTool,
      getTinyImageTool,
      annotatedMessageTool,
      getResourceReferenceTool,
      elicitationTool,
      getResourceLinksTool,
    ];
  • Helper function that generates 100 static test resources (alternating plaintext and binary blobs), called by the tool handler to provide resources for linking.
    export const generateAllResources = (): Resource[] => {
      return Array.from({ length: 100 }, (_, i) => {
        const uri = `test://static/resource/${i + 1}`;
        if (i % 2 === 0) {
          return {
            uri,
            name: `Resource ${i + 1}`,
            mimeType: "text/plain",
            text: `Resource ${i + 1}: This is a plaintext resource`,
          };
        } else {
          const buffer = Buffer.from(`Resource ${i + 1}: This is a base64 blob`);
          return {
            uri,
            name: `Resource ${i + 1}`,
            mimeType: "application/octet-stream",
            blob: buffer.toString("base64"),
          };
        }
      });
    };
Behavior2/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 of behavioral disclosure. It states the tool returns multiple resource links but doesn't explain what a 'resource link' is, how they are selected, whether there are permissions or rate limits, or what the output format looks like. This leaves significant gaps in understanding the tool's behavior.

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 a single sentence that is efficient and front-loaded, stating the core purpose without unnecessary words. However, it could be more structured by including key details like parameter context or usage distinctions.

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

Completeness2/5

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

Given the complexity of returning 'resource links' with no annotations or output schema, the description is incomplete. It fails to clarify what resource links are, how they differ from sibling tools, or what the return values entail, making it inadequate for effective tool selection and invocation.

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 has 100% description coverage, with the 'count' parameter clearly documented in the schema. The description adds no additional meaning beyond what the schema provides, as it doesn't mention parameters at all. With high schema coverage, the baseline score of 3 is appropriate.

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

Purpose3/5

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

The description states the tool 'Returns multiple resource links that reference different types of resources', which provides a basic purpose but is vague about what 'resource links' are and what 'different types of resources' means. It doesn't clearly distinguish this tool from sibling tools like 'getResourceReference' or 'getTinyImage', leaving ambiguity about when to use each.

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. There is no mention of context, prerequisites, or exclusions, and it doesn't reference sibling tools like 'getResourceReference' to help differentiate usage scenarios.

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/soriat/soria-mcp'

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