Skip to main content
Glama
noga7

MCP Content Credentials Server

by noga7

read_credentials_url

Extract and display C2PA Content Credentials from files at URLs to verify creator identity, AI generation details, and content authenticity.

Instructions

Read Content Credentials from a file at a URL. USE THIS TOOL when the user provides a URL AND asks questions like: "who made this", "how was this made", "where does this come from", "is this AI", "is this real", "does this have Content Credentials", "what are the c2pa details", or mentions "c2pa" or "Content Credentials". Downloads the file temporarily, checks for embedded C2PA manifests, then cleans up. If the user asks a SPECIFIC question (e.g., "Is this AI?"), answer their question directly using the relevant data, then offer to share more details from the Content Credentials. If the user asks GENERALLY about the file or its credentials, present the information in this order (SKIP sections that have no data): 1) Who this comes from (use BULLET POINTS, prioritize LinkedIn verified identities at the top - OMIT THIS ENTIRE SECTION if no CAWG or personal identity is found), 2) About this content (actions taken - EXCLUDE "c2pa.opened" actions unless specifically requested), 3) About these Content Credentials (signer and timestamp), 4) Validation info (certificate details).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesHTTP or HTTPS URL of the file to check for Content Credentials

Implementation Reference

  • Core implementation of readCredentialsFromUrl method - validates URL, downloads file to temporary location, reads credentials using readCredentialsFromFile, and ensures cleanup in finally block
    /**
     * Read Content Credentials from a URL
     */
    async readCredentialsFromUrl(url: string): Promise<C2PAResult> {
      logger.info('Reading credentials from URL', { url });
    
      let tempPath: string | null = null;
    
      try {
        // Validate URL
        validateUrl(url);
    
        // Download the file
        tempPath = await downloadFile(url);
    
        // Read credentials from downloaded file
        const result = await this.readCredentialsFromFile(tempPath);
    
        return result;
      } catch (error: unknown) {
        logger.error('Failed to read credentials from URL', error, { url });
    
        const errorMessage = error instanceof Error ? error.message : 'Failed to process URL';
    
        return {
          success: false,
          hasCredentials: false,
          error: errorMessage,
        };
      } finally {
        // Always clean up temporary file
        if (tempPath) {
          await safeDelete(tempPath);
        }
      }
    }
  • MCP tool handler for read_credentials_url in stdio transport - validates url parameter, calls c2paService.readCredentialsFromUrl, and formats the result for MCP response
    case 'read_credentials_url': {
      const params = args as Partial<ReadCredentialsUrlParams>;
      const { url } = params;
    
      if (!url) {
        throw new Error('Missing required parameter: url');
      }
    
      logger.debug('Processing read_credentials_url', { url });
      const result = await c2paService.readCredentialsFromUrl(url);
    
      return {
        content: [
          {
            type: 'text',
            text: formatResult(result),
          },
        ],
      };
    }
  • Type definition for ReadCredentialsUrlParams - defines the url parameter interface for the read_credentials_url tool
    /**
     * Parameters for read_credentials_url tool
     */
    export interface ReadCredentialsUrlParams {
      url: string;
    }
  • src/index.ts:76-92 (registration)
    Tool registration for read_credentials_url in stdio transport - defines tool name, description, usage instructions, and inputSchema with required url parameter
    {
      name: 'read_credentials_url',
      description:
        'Read Content Credentials from a file at a URL. USE THIS TOOL when the user provides a URL AND asks questions like: "who made this", "how was this made", "where does this come from", "is this AI", "is this real", "does this have Content Credentials", "what are the c2pa details", or mentions "c2pa" or "Content Credentials". Downloads the file temporarily, checks for embedded C2PA manifests, then cleans up. ' +
        'If the user asks a SPECIFIC question (e.g., "Is this AI?"), answer their question directly using the relevant data, then offer to share more details from the Content Credentials. ' +
        'If the user asks GENERALLY about the file or its credentials, present the information in this order (SKIP sections that have no data): 1) Who this comes from (use BULLET POINTS, prioritize LinkedIn verified identities at the top - OMIT THIS ENTIRE SECTION if no CAWG or personal identity is found), 2) About this content (actions taken - EXCLUDE "c2pa.opened" actions unless specifically requested), 3) About these Content Credentials (signer and timestamp), 4) Validation info (certificate details).',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: 'HTTP or HTTPS URL of the file to check for Content Credentials',
          },
        },
        required: ['url'],
      },
    },
  • downloadFile helper function - downloads file from URL to temporary location with timeout handling, HTTP error checking, and streaming pipeline for efficient file transfer
    /**
     * Download a file from URL to a temporary location
     * @returns Path to the downloaded temporary file
     */
    export async function downloadFile(url: string): Promise<string> {
      logger.info('Starting file download', { url });
    
      const tempDir = os.tmpdir();
      const fileName = generateTempFileName(url);
      const tempPath = path.join(tempDir, fileName);
    
      try {
        // Create abort controller for timeout
        const controller = new AbortController();
        const timeoutId = setTimeout(() => controller.abort(), DOWNLOAD_TIMEOUT_MS);
    
        const response = await fetch(url, { signal: controller.signal });
        clearTimeout(timeoutId);
    
        if (!response.ok) {
          logger.error('Download failed with HTTP error', undefined, {
            url,
            status: response.status,
            statusText: response.statusText,
          });
          throw new DownloadError(url, response.status);
        }
    
        if (!response.body) {
          logger.error('Download failed: empty response body', undefined, { url });
          throw new DownloadError(url);
        }
    
        const fileStream = createWriteStream(tempPath);
        // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
        await pipeline(Readable.fromWeb(response.body as any), fileStream);
    
        logger.info('File downloaded successfully', { url, tempPath });
        return tempPath;
      } catch (error) {
        logger.error('File download failed', error, { url });
    
        if (error instanceof DownloadError || error instanceof DownloadTimeoutError) {
          throw error;
        }
    
        // Handle abort/timeout
        if (error instanceof Error && error.name === 'AbortError') {
          throw new DownloadTimeoutError(url, DOWNLOAD_TIMEOUT_MS);
        }
    
        throw new DownloadError(url);
      }
    }
Behavior4/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. It effectively describes the tool's behavior: it downloads files temporarily, checks for C2PA manifests, cleans up afterward, and outlines the structured response format. However, it doesn't mention potential errors (e.g., invalid URLs, network issues) or performance characteristics like rate limits, leaving some gaps.

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 appropriately sized and front-loaded with the core purpose and usage guidelines. However, it includes extensive formatting instructions (e.g., bullet points, section ordering) that might be better suited for an output schema or separate documentation, slightly reducing efficiency. Most sentences are necessary for clarity.

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

Completeness4/5

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

Given the tool's complexity (involving file download, C2PA parsing, and structured responses) and lack of annotations/output schema, the description does a good job covering behavior and usage. It explains the processing steps and response format in detail. However, without an output schema, the description must fully define return values, which it does partially but could be more explicit about data types or error cases.

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, so the baseline is 3. The description doesn't add any parameter-specific information beyond what's in the schema (which already defines 'url' as an HTTP/HTTPS URL). No additional syntax, format, or constraints are provided in the description.

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

Purpose5/5

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

The description clearly states the specific action ('Read Content Credentials from a file at a URL'), identifies the resource (file at URL), and distinguishes it from its sibling 'read_credentials_file' by specifying URL-based input rather than file-based input. The verb 'read' is precise and the scope is well-defined.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool ('when the user provides a URL AND asks questions like...'), includes specific example questions (e.g., 'who made this', 'is this AI'), and mentions the sibling tool context. It also gives detailed instructions on how to respond based on user intent (specific vs. general questions), making it highly actionable.

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/noga7/mcp-content-credentials'

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