Skip to main content
Glama
tachote
by tachote

Poll session

poll_interactsh_session

Retrieve and decrypt security testing interactions for a session, with optional filters for HTTP method, path, query, protocol, or text content.

Instructions

Retrieves and decrypts interactions for a session. Optional filters let you match HTTP method, path, query, protocol, or free text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
correlation_idYes
methodNo
path_containsNo
query_containsNo
protocolNo
text_containsNo

Implementation Reference

  • src/server.js:342-375 (registration)
    Registration of the 'poll_interactsh_session' MCP tool, defining metadata, Zod inputSchema, and inline handler function that delegates to service.pollSession and applies filters.
    server.registerTool(
      'poll_interactsh_session',
      {
        title: 'Poll session',
        description:
          'Retrieves and decrypts interactions for a session. Optional filters let you match HTTP method, path, query, protocol, or free text.',
        inputSchema: {
          correlation_id: z.string(),
          method: z.string().optional(),
          path_contains: z.string().optional(),
          query_contains: z.string().optional(),
          protocol: z.string().optional(),
          text_contains: z.string().optional(),
        },
      },
      async ({ correlation_id, ...filters }) => {
        const payload = await service.pollSession(correlation_id);
        const sanitizedFilters = Object.fromEntries(
          Object.entries(filters)
            .filter(([, value]) => value !== undefined && value !== '')
            .map(([key, value]) => [key, typeof value === 'string' ? value : JSON.stringify(value)]),
        );
        const filteredEvents = applyEventFilters(payload.events, sanitizedFilters);
    
        return result({
          applied_filters: sanitizedFilters,
          total_events: payload.events.length,
          matched_events: filteredEvents.length,
          events: filteredEvents,
          extra: payload.extra,
          tld_data: payload.tld_data,
        });
      },
    );
  • Zod input schema for the tool: requires correlation_id, optional filter fields (method, path_contains, query_contains, protocol, text_contains).
    inputSchema: {
      correlation_id: z.string(),
      method: z.string().optional(),
      path_contains: z.string().optional(),
      query_contains: z.string().optional(),
      protocol: z.string().optional(),
      text_contains: z.string().optional(),
    },
  • Inline MCP tool handler: calls service.pollSession, sanitizes and applies filters to events, returns structured content with counts and filtered results.
    async ({ correlation_id, ...filters }) => {
      const payload = await service.pollSession(correlation_id);
      const sanitizedFilters = Object.fromEntries(
        Object.entries(filters)
          .filter(([, value]) => value !== undefined && value !== '')
          .map(([key, value]) => [key, typeof value === 'string' ? value : JSON.stringify(value)]),
      );
      const filteredEvents = applyEventFilters(payload.events, sanitizedFilters);
    
      return result({
        applied_filters: sanitizedFilters,
        total_events: payload.events.length,
        matched_events: filteredEvents.length,
        events: filteredEvents,
        extra: payload.extra,
        tld_data: payload.tld_data,
      });
    },
  • Core InteractshService.pollSession method: authenticates and GET /poll endpoint, decrypts events using session's private key, normalizes extra/tld_data.
    async pollSession(correlationId) {
      const session = this.#requireSession(correlationId);
      const url = new URL('/poll', this.baseUrl);
      url.searchParams.set('id', session.correlationId);
      url.searchParams.set('secret', session.secretKey);
    
      const response = await this.#request(url, { method: 'GET' });
      const payload = await response.json();
    
      const events = this.#decryptEvents(session.privateKey, payload);
      return {
        events,
        extra: normaliseArray(payload.extra),
        tld_data: normaliseArray(payload.tlddata),
      };
    }
  • Helper function to filter decrypted events by HTTP method, protocol, path/query contains, or free-text search across raw/parsed data.
    function applyEventFilters(events, filters) {
      if (!events.length) {
        return [];
      }
    
      const methodFilter = filters.method ? filters.method.toUpperCase() : undefined;
      const protocolFilter = filters.protocol ? filters.protocol.toLowerCase() : undefined;
      const pathFilter = filters.path_contains ? filters.path_contains.toLowerCase() : undefined;
      const queryFilter = filters.query_contains ? filters.query_contains.toLowerCase() : undefined;
      const textFilter = filters.text_contains ? filters.text_contains.toLowerCase() : undefined;
    
      return events
        .map((raw) => {
          const parsed = parseEvent(raw);
          return { raw, ...parsed };
        })
        .filter(({ raw, parsed, http, protocol }) => {
          if (methodFilter && (!http || http.method !== methodFilter)) {
            return false;
          }
          if (pathFilter && (!http || !http.pathLower.includes(pathFilter))) {
            return false;
          }
          if (queryFilter && (!http || !http.queryLower.includes(queryFilter))) {
            return false;
          }
          if (protocolFilter && (!protocol || protocol.toLowerCase() !== protocolFilter)) {
            return false;
          }
          if (textFilter) {
            const haystack = [raw, parsed ? JSON.stringify(parsed) : '', http?.fullPath ?? '']
              .join(' ')
              .toLowerCase();
            if (!haystack.includes(textFilter)) {
              return false;
            }
          }
          return true;
        })
        .map(({ raw, parsed, http, protocol }) => ({
          raw,
          protocol: protocol ?? undefined,
          http: http ?? undefined,
          parsed: parsed ?? undefined,
        }));
    }
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. It mentions 'retrieves and decrypts' which implies read-only behavior, but doesn't address critical aspects like authentication requirements, rate limits, error conditions, or what 'decrypts' entails operationally. For a tool with 6 parameters and no annotation coverage, this leaves significant gaps.

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 perfectly concise and well-structured in just two sentences. The first sentence states the core purpose, and the second explains the filtering capabilities. Every word earns its place with zero redundancy or unnecessary elaboration.

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

Completeness3/5

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

Given the tool's moderate complexity (6 parameters, 1 required), no annotations, and no output schema, the description provides adequate but incomplete context. It covers the purpose and parameter semantics well but lacks behavioral details and usage guidelines. For a tool that 'decrypts' data and has multiple siblings, more comprehensive guidance would be beneficial.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

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

The description provides excellent parameter semantics despite 0% schema description coverage. It clearly explains that 'optional filters let you match HTTP method, path, query, protocol, or free text,' which maps directly to 5 of the 6 parameters (method, path_contains, query_contains, protocol, text_contains). Only 'correlation_id' isn't explicitly mentioned, but its purpose is implied by 'for a session.' This effectively compensates for the schema's lack of descriptions.

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 specific verbs ('retrieves and decrypts') and resource ('interactions for a session'), making it easy to understand what the tool does. However, it doesn't explicitly distinguish this polling tool from its sibling tools (create, deregister, list sessions), which prevents a perfect score.

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 mentions 'optional filters' but provides no guidance on when to use this tool versus its siblings (create_interactsh_session, deregister_interactsh_session, list_interactsh_sessions). There's no indication of prerequisites, sequencing, or alternative scenarios, leaving the agent with minimal context for tool selection.

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/tachote/mcp-interactsh'

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