Skip to main content
Glama

search-source

Search specific sources for Web3 token information by providing token name, ticker, and source type to find relevant data and insights.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenNameYesName of the token
tokenTickerYesTicker symbol of the token
sourceYesSource to search (e.g., 'Dune', 'IQ Wiki', 'News')

Implementation Reference

  • The main handler function for the 'search-source' tool. It takes tokenName, tokenTicker, and source as input, calls the searchSource helper, stores results, fetches content from the top result, saves it as a resource, and returns a formatted text response.
      async ({
        tokenName,
        tokenTicker,
        source,
      }: {
        tokenName: string;
        tokenTicker: string;
        source: string;
      }) => {
        storage.addLogEntry(
          `Searching ${source} for ${tokenName} (${tokenTicker})`
        );
    
        try {
          const results = await searchSource(tokenName, tokenTicker, source);
    
          storage.addToSection("searchResults", {
            [source]: results,
          });
    
          let responseText = `Search results for ${source} about ${tokenName} (${tokenTicker}):\n\n`;
    
          if (results.results && results.results.length > 0) {
            const topResults = results.results.slice(0, 5);
            responseText += JSON.stringify(topResults, null, 2);
    
            if (topResults[0] && topResults[0].url) {
              const url = topResults[0].url;
              responseText += `\n\nFetching content from top result: ${url}`;
    
              try {
                await sleep(3000);
    
                const content = await fetchContent(url, "text");
                const resourceId = `${source.toLowerCase()}_${tokenName.toLowerCase()}_${new Date().getTime()}`;
    
                storage.addToSection("resources", {
                  [resourceId]: {
                    url,
                    format: "text",
                    content,
                    source,
                    fetchedAt: new Date().toISOString(),
                  },
                });
    
                responseText += `\n\nContent has been saved as a resource. Use 'research://resource/${resourceId}' to access it.`;
              } catch (fetchError) {
                responseText += `\n\nCould not fetch content from URL: ${fetchError}`;
              }
            }
          } else {
            responseText += `No results found.`;
          }
    
          return {
            content: [
              {
                type: "text",
                text: responseText,
              },
            ],
          };
        } catch (error) {
          storage.addLogEntry(`Error searching ${source}: ${error}`);
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: `Error searching ${source}: ${error}`,
              },
            ],
          };
        }
      }
    );
  • Zod input schema for the 'search-source' tool defining parameters tokenName, tokenTicker, and source.
    {
      tokenName: z.string().describe("Name of the token"),
      tokenTicker: z.string().describe("Ticker symbol of the token"),
      source: z
        .string()
        .describe("Source to search (e.g., 'Dune', 'IQ Wiki', 'News')"),
    },
  • Registration of the 'search-source' tool in registerResearchTools function using McpServer.tool().
    server.tool(
      "search-source",
      {
        tokenName: z.string().describe("Name of the token"),
        tokenTicker: z.string().describe("Ticker symbol of the token"),
        source: z
          .string()
          .describe("Source to search (e.g., 'Dune', 'IQ Wiki', 'News')"),
      },
      async ({
        tokenName,
        tokenTicker,
        source,
      }: {
        tokenName: string;
        tokenTicker: string;
        source: string;
      }) => {
        storage.addLogEntry(
          `Searching ${source} for ${tokenName} (${tokenTicker})`
        );
    
        try {
          const results = await searchSource(tokenName, tokenTicker, source);
    
          storage.addToSection("searchResults", {
            [source]: results,
          });
    
          let responseText = `Search results for ${source} about ${tokenName} (${tokenTicker}):\n\n`;
    
          if (results.results && results.results.length > 0) {
            const topResults = results.results.slice(0, 5);
            responseText += JSON.stringify(topResults, null, 2);
    
            if (topResults[0] && topResults[0].url) {
              const url = topResults[0].url;
              responseText += `\n\nFetching content from top result: ${url}`;
    
              try {
                await sleep(3000);
    
                const content = await fetchContent(url, "text");
                const resourceId = `${source.toLowerCase()}_${tokenName.toLowerCase()}_${new Date().getTime()}`;
    
                storage.addToSection("resources", {
                  [resourceId]: {
                    url,
                    format: "text",
                    content,
                    source,
                    fetchedAt: new Date().toISOString(),
                  },
                });
    
                responseText += `\n\nContent has been saved as a resource. Use 'research://resource/${resourceId}' to access it.`;
              } catch (fetchError) {
                responseText += `\n\nCould not fetch content from URL: ${fetchError}`;
              }
            }
          } else {
            responseText += `No results found.`;
          }
    
          return {
            content: [
              {
                type: "text",
                text: responseText,
              },
            ],
          };
        } catch (error) {
          storage.addLogEntry(`Error searching ${source}: ${error}`);
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: `Error searching ${source}: ${error}`,
              },
            ],
          };
        }
      }
    );
  • Helper function implementing the core search logic for specific sources by adding relevant extra search terms and delegating to performSearch (which uses DuckDuckGo scraper). This is the exact implementation of the search functionality called by the tool handler.
    export async function searchSource(
      tokenName: string,
      tokenTicker: string,
      source: string
    ): Promise<any> {
      const extraTerms = ["crypto", "token"];
    
      switch (source.toLowerCase()) {
        case "coinmarketcap":
          extraTerms.push("price", "market", "chart");
          break;
        case "docs":
          extraTerms.push("documentation", "whitepaper", "github");
          break;
        case "vesting":
          extraTerms.push("tokenomics", "schedule", "unlock");
          break;
        case "raise":
          extraTerms.push("funding", "investment", "ico", "seed");
          break;
        case "news":
          extraTerms.push("latest", "announcement", "update");
          break;
        case "crypto token":
        case "dashboard":
        case "iq wiki":
        case "dune":
          extraTerms.push("dashboard", "crypto", "stats");
          break;
        case "airdrop":
          break;
        default:
      }
    
      const query = `${tokenName} ${tokenTicker} ${source} ${extraTerms.join(" ")}`;
    
      if (source.toLowerCase() === "news") {
        return performSearch(query, "news");
      }
    
      return performSearch(query, "web");
    }
  • Top-level tool registration entrypoint that invokes registerResearchTools, which registers 'search-source' among other tools.
    export function registerAllTools(
      server: McpServer,
      storage: ResearchStorage
    ): void {
      registerResearchTools(server, storage);
    }
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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/aaronjmars/web3-research-mcp'

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