> ## Documentation Index
> Fetch the complete documentation index at: https://docs.echozero.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Analyze pasted signal samples for an owned agent

> Same as analyze-preview but attributes rate limits per agent. Owning developer only.



## OpenAPI

````yaml https://mcp.echozero.app/api/docs-json post /api/v1/developers/agents/{id}/signal-corpus/analyze
openapi: 3.0.0
info:
  title: EchoZero MCP API
  description: >-
    EchoZero MCP Server - Developer API for agent management, trading,
    marketplace, and AI chat.


    **Rate Limiting:** All endpoints enforce per-API-key rate limits. Tiers:
    free (60 req/min), standard (300 req/min), premium (1000 req/min). Every
    response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`,
    `X-RateLimit-Reset` headers. Exceeding the limit returns `429 Too Many
    Requests` with a `Retry-After` header.
  version: '1.0'
  contact: {}
servers:
  - url: https://mcp.echozero.app
    description: Production
security: []
tags:
  - name: MCP Protocol
    description: >-
      Model Context Protocol (Streamable HTTP): `/mcp`, `/mcp/sse` — not under
      `/api`; same API key as REST
  - name: Health
    description: Server health check
  - name: API Keys
    description: API key generation, listing, and revocation
  - name: User
    description: >-
      User profile, sessions, social, onboarding, internal agent subscriptions,
      and bot activations (v1: /v1/users/me)
  - name: Token
    description: Token data and trending
  - name: Trade
    description: Trade execution and history
  - name: Strategy
    description: Strategy (trading bot) configuration and control
  - name: Agent
    description: Agent registration and management
  - name: AI
    description: AI chat, intent, and insights
  - name: Wallet
    description: Wallet operations, deposits, and withdrawals
  - name: Notification
    description: Notification management and settings
  - name: Auth
    description: >-
      Public authentication: signup / login lookup, code verification, Google
      OAuth, refresh, and sign-out. Returns `accessToken` / `refreshToken` in
      the JSON body.
  - name: OAuth
    description: >-
      OAuth 2.1 authorization-code + PKCE for AI assistant clients:
      `/oauth/authorize`, `/oauth/token`, `/oauth/introspect`, `/status`.
  - name: Activity
    description: User trade activity list and search
  - name: Feed
    description: Social activity feed timeline
  - name: Earn
    description: Leaderboard, rewards, and referrals
  - name: Statics
    description: Countries, languages, and static data
  - name: Misc
    description: File uploads and utility endpoints
  - name: Developer
    description: Developer registration and profile
  - name: Developer dashboard
    description: >-
      Per-agent dashboard: subscribers (anonymized), performance detail, signal
      history (v1)
  - name: Developer Agent
    description: Developer agent listings and management
  - name: Developer Agents (Marketplace)
    description: Public browse, search, and subscribe to external developer-listed agents
  - name: Admin
    description: Admin-only endpoints for review, approval, and platform management
  - name: Webhooks
    description: >-
      Inbound provider webhooks (no API key). Telegram signal-bot uses
      `X-Telegram-Bot-Api-Secret-Token` when configured.
paths:
  /api/v1/developers/agents/{id}/signal-corpus/analyze:
    post:
      tags:
        - Developer signal corpus
      summary: Analyze pasted signal samples for an owned agent
      description: >-
        Same as analyze-preview but attributes rate limits per agent. Owning
        developer only.
      operationId: SignalCorpusController_analyzeForAgent
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: x-signature
          in: header
          required: false
          description: >-
            HMAC-SHA256 signature: HMAC-SHA256(secretKey, timestamp + METHOD +
            path + body). Optional -- when omitted, HMAC verification is
            skipped.
          schema:
            type: string
        - name: x-timestamp
          in: header
          required: false
          description: >-
            Request timestamp in epoch milliseconds. Required when x-signature
            is provided. Rejected if drift exceeds 5 minutes.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignalCorpusAnalyzeRequestDto'
      responses:
        '200':
          description: Suggested detection rule + coverage stats.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/McpSuccessResponseDto'
                  - properties:
                      data:
                        $ref: '#/components/schemas/SignalCorpusAnalyzeResponseDto'
        '400':
          description: Invalid corpus or analysis failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpErrorResponseDto'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpErrorResponseDto'
        '403':
          description: Not a registered developer or not owner.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpErrorResponseDto'
        '404':
          description: Agent not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpErrorResponseDto'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpErrorResponseDto'
        '503':
          description: Analyzer disabled or AI unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpErrorResponseDto'
      security:
        - bearer-jwt: []
        - api-key: []
components:
  schemas:
    SignalCorpusAnalyzeRequestDto:
      type: object
      properties:
        samplesText:
          type: string
          description: Raw pasted channel messages (newline or blank-line separated).
        messageDelimiter:
          type: string
          enum:
            - newline
            - blankline
            - telegram_export
            - discord_export
          description: >-
            telegram_export / discord_export merge desktop copy-selected paste;
            omit to auto-detect.
        existingRule:
          description: Current rule on the form — used for diff context only in v1.
          allOf:
            - $ref: '#/components/schemas/SignalDetectionRuleDto'
      required:
        - samplesText
    McpSuccessResponseDto:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          description: Endpoint-specific payload
          additionalProperties: true
      required:
        - success
        - data
    SignalCorpusAnalyzeResponseDto:
      type: object
      properties:
        analysisId:
          type: string
        messageCount:
          type: number
        rawLineCount:
          type: number
          description: Logical messages after preprocess (may be less than raw lines).
        delimiterUsed:
          type: string
          enum:
            - newline
            - blankline
            - telegram_export
            - discord_export
        summary:
          type: string
        confidence:
          type: string
          enum:
            - low
            - medium
            - high
        suggestedRule:
          $ref: '#/components/schemas/SignalDetectionRuleDto'
        coverage:
          $ref: '#/components/schemas/SignalCorpusCoverageDto'
        riskFlags:
          type: array
          items:
            $ref: '#/components/schemas/SignalCorpusRiskFlagDto'
        parsePreview:
          type: array
          items:
            $ref: '#/components/schemas/SignalCorpusParsePreviewLineDto'
        keywordStats:
          type: object
          description: Per-bucket keyword hit counts over the pasted corpus.
        corpusMessages:
          type: array
          items:
            $ref: '#/components/schemas/SignalCorpusCorpusMessageDto'
        diff:
          type: array
          items:
            $ref: '#/components/schemas/SignalCorpusBucketDiffDto'
        warnings:
          type: array
          items:
            type: string
        strategyPrefixRecommendation:
          $ref: '#/components/schemas/SignalCorpusStrategyPrefixRecommendationDto'
        model:
          type: string
        expiresAt:
          type: string
      required:
        - analysisId
        - messageCount
        - rawLineCount
        - delimiterUsed
        - summary
        - confidence
        - suggestedRule
        - coverage
        - riskFlags
        - parsePreview
        - keywordStats
        - corpusMessages
        - diff
        - warnings
        - strategyPrefixRecommendation
        - expiresAt
    McpErrorResponseDto:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          $ref: '#/components/schemas/McpErrorBodyDto'
      required:
        - success
        - error
    SignalDetectionRuleDto:
      type: object
      properties:
        buyKeywords:
          maxItems: 200
          type: array
          items:
            type: string
        sellKeywords:
          maxItems: 200
          type: array
          items:
            type: string
        longKeywords:
          maxItems: 200
          type: array
          items:
            type: string
        shortKeywords:
          maxItems: 200
          type: array
          items:
            type: string
        tpKeywords:
          maxItems: 200
          type: array
          items:
            type: string
        slKeywords:
          maxItems: 200
          type: array
          items:
            type: string
        leverageKeywords:
          maxItems: 200
          description: >-
            When set, numeric leverage is only read from the message if it also
            contains one of these labels (e.g. LEV, LEVERAGE, CROSS). Empty =
            detect 5× / leverage: 10 anywhere.
          type: array
          items:
            type: string
        tokenPatterns:
          maxItems: 200
          type: array
          items:
            type: string
        strategyPrefix:
          type: string
          description: Optional line prefix filter (case-insensitive).
        cancelKeywords:
          maxItems: 200
          type: array
          items:
            type: string
        breakevenKeywords:
          maxItems: 200
          type: array
          items:
            type: string
        partialCloseKeywords:
          maxItems: 200
          type: array
          items:
            type: string
        breakoutAboveKeywords:
          maxItems: 200
          type: array
          items:
            type: string
        breakoutBelowKeywords:
          maxItems: 200
          type: array
          items:
            type: string
        entryZoneKeywords:
          maxItems: 200
          type: array
          items:
            type: string
    SignalCorpusCoverageDto:
      type: object
      properties:
        keywordGateHitPct:
          type: number
        unmatchedLineIndexes:
          type: array
          items:
            type: number
      required:
        - keywordGateHitPct
        - unmatchedLineIndexes
    SignalCorpusRiskFlagDto:
      type: object
      properties:
        keyword:
          type: string
        reason:
          type: string
      required:
        - keyword
        - reason
    SignalCorpusParsePreviewLineDto:
      type: object
      properties:
        lineIndex:
          type: number
        text:
          type: string
        ingressHit:
          type: boolean
        matched:
          type: boolean
        token:
          type: string
        intent:
          type: string
        summary:
          type: string
      required:
        - lineIndex
        - text
        - ingressHit
        - matched
        - token
        - intent
        - summary
    SignalCorpusCorpusMessageDto:
      type: object
      properties:
        lineIndex:
          type: number
        text:
          type: string
      required:
        - lineIndex
        - text
    SignalCorpusBucketDiffDto:
      type: object
      properties:
        bucket:
          type: string
        added:
          type: array
          items:
            type: string
        unchanged:
          type: array
          items:
            type: string
      required:
        - bucket
        - added
        - unchanged
    SignalCorpusStrategyPrefixRecommendationDto:
      type: object
      properties:
        value:
          type: string
          description: Suggested prefix text (empty when not recommended).
        apply:
          type: boolean
          description: >-
            Whether suggestedRule.strategyPrefix was set from this
            recommendation.
        reason:
          type: string
          description: Short explanation from AI (and server validation).
      required:
        - value
        - apply
        - reason
    McpErrorBodyDto:
      type: object
      properties:
        code:
          type: string
          example: NOT_FOUND
        message:
          type: string
          example: Resource not found
      required:
        - code
        - message
  securitySchemes:
    bearer-jwt:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: >-
        User JWT access token issued by `POST /api/auth/verify` or `POST
        /api/auth/social/verify`. Routes that accept both auth modes declare
        `api-key` *and* `bearer-jwt` security schemes.
    api-key:
      type: apiKey
      in: header
      name: x-api-key

````