MCPcopy Create free account
hub / github.com/idosal/git-mcp / generateFetchToolDescription

Function generateFetchToolDescription

src/api/tools/commonTools.ts:913–933  ·  view source on GitHub ↗
({
  urlType,
  owner,
  repo,
}: Omit<RepoData, "host">)

Source from the content-addressed store, hash-verified

911 * @returns A descriptive string for the tool
912 */
913export function generateFetchToolDescription({
914 urlType,
915 owner,
916 repo,
917}: Omit<RepoData, "host">): string {
918 try {
919 // Default description as fallback
920 let description = "Fetch entire documentation for the current repository.";
921
922 if (urlType == "subdomain") {
923 description = `Fetch entire documentation file from the ${owner}/${repo} GitHub Pages. Useful for general questions. Always call this tool first if asked about ${owner}/${repo}.`;
924 } else if (urlType == "github") {
925 description = `Fetch entire documentation file from GitHub repository: ${owner}/${repo}. Useful for general questions. Always call this tool first if asked about ${owner}/${repo}.`;
926 }
927
928 return description;
929 } catch (error) {
930 // Return default description if there's any error parsing the URL
931 return "Fetch documentation for the current repository.";
932 }
933}
934
935/**
936 * Generate a dynamic tool name for the fetch_documentation tool based on the URL

Callers 1

getToolsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected