Skip to main content
Glama
hofill
by hofill

get_shared_request

Retrieve and inspect shared HTTP request data from RequestRepo MCP by resolving a share token. Access captured web requests, headers, and optional body content for analysis.

Instructions

Resolve a shared request token.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
share_tokenYes
include_rawNo
include_bodyNo
max_bytesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core business logic handler that retrieves a shared request by token, serializes it with options for including raw data and body content, and returns the structured response.
    def get_shared_request(
        self,
        *,
        share_token: str,
        include_raw: bool = False,
        include_body: bool = False,
        max_bytes: int | None = None,
    ) -> dict[str, Any]:
        request = self._client().get_shared_request(share_token)
        return {
            "share_token": share_token,
            "request": serialize_request(
                request,
                include_raw=include_raw,
                include_body=include_body,
                max_bytes=self._resolved_max_bytes(max_bytes),
            ),
        }
  • MCP tool registration that exposes the get_shared_request functionality with the @mcp.tool() decorator, defining the tool's parameters and delegation to the service layer.
    @mcp.tool()
    def get_shared_request(
        share_token: str,
        include_raw: bool = False,
        include_body: bool = False,
        max_bytes: int = 65536,
    ) -> dict[str, Any]:
        """Resolve a shared request token."""
        return resolved_service.get_shared_request(
            share_token=share_token,
            include_raw=include_raw,
            include_body=include_body,
            max_bytes=max_bytes,
        )
  • Serialization helper that converts request objects (HttpRequest, DnsRequest, SmtpRequest, TcpRequest) into dictionary format with optional raw data and body content, handling byte truncation based on max_bytes limit.
    def serialize_request(
        request: HttpRequest | DnsRequest | SmtpRequest | TcpRequest,
        *,
        include_raw: bool,
        include_body: bool,
        max_bytes: int,
    ) -> dict[str, Any]:
        payload: dict[str, Any] = {
            "id": request.id,
            "type": request.type,
            "uid": request.uid,
            "ip": request.ip,
            "country": request.country,
            "date_unix": request.date,
            "date_iso": _iso_from_unix(request.date),
        }
    
        if isinstance(request, HttpRequest):
            payload.update(
                {
                    "method": request.method,
                    "path": request.path,
                    "http_version": request.http_version,
                    "headers": request.headers,
                }
            )
            if include_body and request.body is not None:
                payload["body"] = bytes_envelope(request.body, max_bytes=max_bytes)
        elif isinstance(request, DnsRequest):
            payload.update(
                {
                    "port": request.port,
                    "query_type": request.query_type,
                    "domain": request.domain,
                    "reply": request.reply,
                }
            )
        elif isinstance(request, SmtpRequest):
            payload.update(
                {
                    "command": request.command,
                    "data": request.data,
                    "subject": request.subject,
                    "from_addr": request.from_addr,
                    "to": request.to,
                    "cc": request.cc,
                    "bcc": request.bcc,
                }
            )
        elif isinstance(request, TcpRequest):
            payload.update({"port": request.port})
    
        if include_raw:
            payload["raw"] = bytes_envelope(request.raw, max_bytes=max_bytes)
    
        return payload
Behavior2/5

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

With no annotations, the description carries full burden but only states 'Resolve' without explaining behavior—e.g., what 'resolve' does (e.g., retrieves data, validates token), potential side effects, authentication needs, or rate limits. It lacks details on return format or error handling, leaving key behavioral traits undisclosed.

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 a single, efficient sentence with no wasted words, making it front-loaded and easy to parse. However, its brevity leads to under-specification, slightly reducing effectiveness despite good structure.

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?

Given 4 parameters with 0% schema coverage, no annotations, and an output schema (which helps but isn't described), the description is incomplete. It doesn't address parameter meanings, behavioral context, or usage scenarios, failing to provide enough context 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?

Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain what 'share_token' is, what 'include_raw' or 'include_body' toggle, or how 'max_bytes' affects output. With 4 parameters and no schema descriptions, this is a significant gap in semantic clarity.

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

Purpose3/5

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

The description 'Resolve a shared request token' states a clear verb ('Resolve') and resource ('shared request token'), but it's vague about what 'resolve' entails—does it retrieve, validate, or process the request? It doesn't distinguish from siblings like 'share_request' or 'get_file', leaving ambiguity in purpose.

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?

No guidance is provided on when to use this tool versus alternatives. Siblings include 'share_request' (likely creates tokens) and 'get_file' (retrieves files), but the description doesn't clarify if this is for accessing shared content, verifying tokens, or other contexts, offering no usage context or exclusions.

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/hofill/RequestRepo-MCP'

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