MCP Server API

Structured output models for pyfetcher MCP tools.

Purpose:

Provide Pydantic models for MCP tool return values, ensuring LLMs receive well-structured, typed data from every tool call.

class pyfetcher.mcp.models.FetchResult(*, url, final_url, status_code, ok, content_type=None, headers=<factory>, text=None, elapsed_ms, backend)[source]

Structured result from fetching a URL.

Parameters:
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyfetcher.mcp.models.ScrapeResult(*, url, selector, elements=<factory>, count)[source]

Structured result from CSS selector extraction.

Parameters:
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyfetcher.mcp.models.LinkInfo(*, url, text, is_external)[source]

Single extracted link.

Parameters:
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyfetcher.mcp.models.LinksResult(*, url, links=<factory>, total, internal, external)[source]

Structured result from link extraction.

Parameters:
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyfetcher.mcp.models.MetadataResult(*, url, title=None, description=None, canonical_url=None, og_title=None, og_description=None, og_image=None, og_type=None, favicons=<factory>)[source]

Structured result from metadata extraction.

Parameters:
  • url (str)

  • title (str | None)

  • description (str | None)

  • canonical_url (str | None)

  • og_title (str | None)

  • og_description (str | None)

  • og_image (str | None)

  • og_type (str | None)

  • favicons (list[str])

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyfetcher.mcp.models.FormInfo(*, action, method, fields=<factory>)[source]

Single extracted form.

Parameters:
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyfetcher.mcp.models.FormsResult(*, url, forms=<factory>, count)[source]

Structured result from form extraction.

Parameters:
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyfetcher.mcp.models.TableResult(*, url, selector, rows=<factory>, row_count)[source]

Structured result from table extraction.

Parameters:
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyfetcher.mcp.models.RobotsResult(*, url, path, user_agent, allowed, sitemaps=<factory>)[source]

Structured result from robots.txt check.

Parameters:
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyfetcher.mcp.models.SitemapResult(*, url, entries=<factory>, count)[source]

Structured result from sitemap parsing.

Parameters:
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyfetcher.mcp.models.HeadersResult(*, profile, headers=<factory>)[source]

Structured result from header generation.

Parameters:
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyfetcher.mcp.models.ProfileInfo(*, name, browser, platform, mobile)[source]

Browser profile information.

Parameters:
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyfetcher.mcp.models.ArticleResult(*, url, text=None, markdown=None, title=None)[source]

Structured result from article extraction.

Parameters:
  • url (str)

  • text (str | None)

  • markdown (str | None)

  • title (str | None)

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyfetcher.mcp.models.DownloadResult(*, url, path, size_bytes, checksum_sha256=None)[source]

Structured result from file download.

Parameters:
  • url (str)

  • path (str)

  • size_bytes (int)

  • checksum_sha256 (str | None)

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].