Skip to main content
Glama
scmdr

SourceSync.ai MCP Server

by scmdr

fetchUrlContent

Extract content from web URLs to retrieve parsed text files for knowledge management and content ingestion.

Instructions

Fetches the content of a URL. Particularly useful for fetching parsed text file URLs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
apiKeyNo
tenantIdNo

Implementation Reference

  • The handler function that fetches the content from the provided URL using the wretch library. Supports optional API key authentication and tenant ID header. Wraps the fetch in safeApiCall for consistent error handling.
    async (params: FetchUrlContentParams) => {
      return safeApiCall(async () => {
        const { url, apiKey, tenantId } = params
    
        try {
          // Create a wretch client with authentication if provided
          let client = wretch(url)
    
          if (apiKey) {
            client = client.auth(`Bearer ${apiKey}`)
          }
    
          if (tenantId) {
            client = client.headers({
              'X-Tenant-ID': tenantId,
            })
          }
    
          // Fetch the content from the URL
          const content = await client.get().text()
          return { content }
        } catch (error: any) {
          throw new Error(`Error fetching URL content: ${error.message}`)
        }
      })
    },
  • src/index.ts:735-765 (registration)
    The server.tool call that registers the 'fetchUrlContent' tool with its description, input schema, and handler function.
    server.tool(
      'fetchUrlContent',
      'Fetches the content of a URL. Particularly useful for fetching parsed text file URLs.',
      FetchUrlContentSchema.shape,
      async (params: FetchUrlContentParams) => {
        return safeApiCall(async () => {
          const { url, apiKey, tenantId } = params
    
          try {
            // Create a wretch client with authentication if provided
            let client = wretch(url)
    
            if (apiKey) {
              client = client.auth(`Bearer ${apiKey}`)
            }
    
            if (tenantId) {
              client = client.headers({
                'X-Tenant-ID': tenantId,
              })
            }
    
            // Fetch the content from the URL
            const content = await client.get().text()
            return { content }
          } catch (error: any) {
            throw new Error(`Error fetching URL content: ${error.message}`)
          }
        })
      },
    )
  • Zod schema definition for the input parameters of fetchUrlContent: url (required string URL), optional apiKey and tenantId.
    export const FetchUrlContentSchema = z.object({
      url: z.string().url(),
      // Authentication might be needed for some SourceSync URLs
      apiKey: apiKeySchema,
      tenantId: tenantIdSchema,
    })
    
    export type FetchUrlContentParams = z.infer<typeof FetchUrlContentSchema>
Behavior2/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. While 'fetches' implies a read operation, it doesn't describe what happens on failure, rate limits, authentication requirements (despite apiKey and tenantId parameters), response format, or whether the operation is idempotent. The mention of 'parsed text file URLs' adds some context but leaves most behavioral aspects unspecified.

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 extremely concise - just two sentences that directly address the tool's purpose and a specific use case. Every word earns its place with no redundancy or unnecessary elaboration, making it easy to parse quickly.

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?

For a tool with 3 parameters (including authentication parameters), 0% schema description coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain the authentication mechanism, response format, error conditions, or how the 'parsed text' aspect relates to the parameters. The description leaves too many open questions 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.

Parameters2/5

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

With 0% schema description coverage for all 3 parameters, the description provides no information about what 'url', 'apiKey', or 'tenantId' parameters mean or how they should be used. The description mentions 'URL' generally but doesn't explain format expectations, and completely ignores the authentication parameters that appear in the schema.

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

Purpose4/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 a specific verb ('fetches') and resource ('content of a URL'), and adds useful context about being 'particularly useful for fetching parsed text file URLs.' However, it doesn't explicitly differentiate from sibling tools like 'fetchDocuments' or 'ingestUrls' which might have overlapping functionality.

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 minimal guidance - only mentioning it's 'particularly useful for fetching parsed text file URLs.' It doesn't explain when to use this tool versus alternatives like 'fetchDocuments' or 'ingestUrls' from the sibling list, nor does it mention prerequisites, authentication needs, or any exclusion criteria.

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/scmdr/sourcesyncai-mcp'

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