Skip to main content
Glama
egegungordu

Kokkai Minutes MCP Agent

by egegungordu

searchMeetingList

Search Japanese Diet meeting summaries by date, house, keywords, or speaker to find basic meeting information without speech text.

Instructions

Searches for meeting summaries from the Kokkai API (会議単位簡易出力). Returns basic info like meeting name, date, ID, URL. Does not include speech text. Max 100 records.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startRecordNoStart position for retrieving search results (1-based). Default is 1.
nameOfHouseNoName of the House (e.g., '衆議院' for House of Representatives, '参議院' for House of Councillors). '両院' and '両院協議会' yield the same results.
nameOfMeetingNoName of the meeting (e.g., plenary session, committee). Partial match. Multiple terms separated by space for OR search.
anyNoKeywords to search in speech content. Partial match. Multiple terms separated by space for AND search.
speakerNoSpeaker's name. Partial match. Multiple names separated by space for OR search.
fromNoStart date for meeting search (YYYY-MM-DD). Default '0000-01-01'.
untilNoEnd date for meeting search (YYYY-MM-DD). Default '9999-12-31'.
supplementAndAppendixNoLimit search to supplements and appendices. Default false.
contentsAndIndexNoLimit search to table of contents and index. Default false.
searchRangeNoSpecifies where to search for keywords from 'any' parameter: '冒頭' (opening), '本文' (body), or '冒頭・本文' (both). Default '冒頭・本文'.
closingNoLimit search to meetings held during recess. Default false.
speechNumberNoExact match for speech number (e.g., 10).
speakerPositionNoSpeaker's position/title. Partial match.
speakerGroupNoSpeaker's affiliated political group. Partial match.
speakerRoleNoSpeaker's role: '証人' (witness), '参考人' (expert witness/referential speaker), '公述人' (public speaker).
speechIDNoUnique ID for a speech (format: issueID_paddedSpeechNumber, e.g., '100105254X00119470520_000'). Exact match.
issueIDNoUnique ID for a meeting record (21 alphanumeric characters, e.g., '100105254X00119470520'). Exact match.
sessionFromNoStarting Diet session number (up to 3 digits).
sessionToNoEnding Diet session number (up to 3 digits).
issueFromNoStarting issue number (up to 3 digits, 0 for TOC/index/appendix/supplement).
issueToNoEnding issue number (up to 3 digits, 0 for TOC/index/appendix/supplement).
maximumRecordsNoMaximum number of records to retrieve (1-100) for meeting list. Default is 30.

Implementation Reference

  • Handler function that calls the Kokkai API 'meeting_list' endpoint with the provided parameters, handles errors, and returns the result as formatted JSON text.
    async (params) => {
      const result = await this._callKokkaiApi(
        "meeting_list",
        params
      );
      if (result.error) {
        return {
          content: [
            {
              type: "text",
              text: `Error fetching meeting list: ${result.message} ${result.details || ""}`,
            },
          ],
        };
      }
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Common schema parameters shared across all Kokkai API search tools, defining input validation for search criteria like dates, speakers, keywords, etc.
    const kokkaiCommonSearchParams = {
      startRecord: z
        .number()
        .int()
        .min(1)
        .optional()
        .describe(
          "Start position for retrieving search results (1-based). Default is 1."
        ),
      nameOfHouse: z
        .enum(["衆議院", "参議院", "両院", "両院協議会"])
        .optional()
        .describe(
          "Name of the House (e.g., '衆議院' for House of Representatives, '参議院' for House of Councillors). '両院' and '両院協議会' yield the same results."
        ),
      nameOfMeeting: z
        .string()
        .optional()
        .describe(
          "Name of the meeting (e.g., plenary session, committee). Partial match. Multiple terms separated by space for OR search."
        ),
      any: z
        .string()
        .optional()
        .describe(
          "Keywords to search in speech content. Partial match. Multiple terms separated by space for AND search."
        ),
      speaker: z
        .string()
        .optional()
        .describe(
          "Speaker's name. Partial match. Multiple names separated by space for OR search."
        ),
      from: z
        .string()
        .regex(/^\d{4}-\d{2}-\d{2}$/, "Date must be in YYYY-MM-DD format")
        .optional()
        .describe(
          "Start date for meeting search (YYYY-MM-DD). Default '0000-01-01'."
        ),
      until: z
        .string()
        .regex(/^\d{4}-\d{2}-\d{2}$/, "Date must be in YYYY-MM-DD format")
        .optional()
        .describe(
          "End date for meeting search (YYYY-MM-DD). Default '9999-12-31'."
        ),
      supplementAndAppendix: z
        .boolean()
        .optional()
        .describe(
          "Limit search to supplements and appendices. Default false."
        ),
      contentsAndIndex: z
        .boolean()
        .optional()
        .describe("Limit search to table of contents and index. Default false."),
      searchRange: z
        .enum(["冒頭", "本文", "冒頭・本文"])
        .optional()
        .describe(
          "Specifies where to search for keywords from 'any' parameter: '冒頭' (opening), '本文' (body), or '冒頭・本文' (both). Default '冒頭・本文'."
        ),
      closing: z
        .boolean()
        .optional()
        .describe("Limit search to meetings held during recess. Default false."),
      speechNumber: z
        .number()
        .int()
        .nonnegative()
        .optional()
        .describe("Exact match for speech number (e.g., 10)."),
      speakerPosition: z
        .string()
        .optional()
        .describe("Speaker's position/title. Partial match."),
      speakerGroup: z
        .string()
        .optional()
        .describe("Speaker's affiliated political group. Partial match."),
      speakerRole: z
        .enum(["証人", "参考人", "公述人"])
        .optional()
        .describe(
          "Speaker's role: '証人' (witness), '参考人' (expert witness/referential speaker), '公述人' (public speaker)."
        ),
      speechID: z
        .string()
        .optional()
        .describe(
          "Unique ID for a speech (format: issueID_paddedSpeechNumber, e.g., '100105254X00119470520_000'). Exact match."
        ),
      issueID: z
        .string()
        .optional()
        .describe(
          "Unique ID for a meeting record (21 alphanumeric characters, e.g., '100105254X00119470520'). Exact match."
        ),
      sessionFrom: z
        .number()
        .int()
        .positive()
        .optional()
        .describe("Starting Diet session number (up to 3 digits)."),
      sessionTo: z
        .number()
        .int()
        .positive()
        .optional()
        .describe("Ending Diet session number (up to 3 digits)."),
      issueFrom: z
        .number()
        .int()
        .nonnegative()
        .optional()
        .describe(
          "Starting issue number (up to 3 digits, 0 for TOC/index/appendix/supplement)."
        ),
      issueTo: z
        .number()
        .int()
        .nonnegative()
        .optional()
        .describe(
          "Ending issue number (up to 3 digits, 0 for TOC/index/appendix/supplement)."
        ),
      // recordPacking is handled internally, always 'json'
    };
  • Specific input schema for searchMeetingList tool, extending common params with maximumRecords limit.
    {
      ...kokkaiCommonSearchParams,
      maximumRecords: z
        .number()
        .int()
        .min(1)
        .max(100)
        .optional()
        .describe(
          "Maximum number of records to retrieve (1-100) for meeting list. Default is 30."
        ),
    },
  • src/index.ts:201-239 (registration)
    Registration of the searchMeetingList tool on the MCP server, including name, description, input schema, and handler function.
      "searchMeetingList",
      "Searches for meeting summaries from the Kokkai API (会議単位簡易出力). Returns basic info like meeting name, date, ID, URL. Does not include speech text. Max 100 records.",
      {
        ...kokkaiCommonSearchParams,
        maximumRecords: z
          .number()
          .int()
          .min(1)
          .max(100)
          .optional()
          .describe(
            "Maximum number of records to retrieve (1-100) for meeting list. Default is 30."
          ),
      },
      async (params) => {
        const result = await this._callKokkaiApi(
          "meeting_list",
          params
        );
        if (result.error) {
          return {
            content: [
              {
                type: "text",
                text: `Error fetching meeting list: ${result.message} ${result.details || ""}`,
              },
            ],
          };
        }
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      }
    );
  • Helper method used by all tools to make HTTP requests to the Kokkai API, construct query parameters, handle responses and errors.
    private async _callKokkaiApi(
      endpoint: string,
      params: Record<string, any>
    ): Promise<any> {
      const queryParams = new URLSearchParams();
      for (const key in params) {
        if (params[key] !== undefined && params[key] !== null) {
          queryParams.append(key, String(params[key]));
        }
      }
      queryParams.append("recordPacking", "json"); // Always request JSON
    
      const url = `${KOKKAI_API_BASE_URL}/${endpoint}?${queryParams.toString()}`;
      console.log(`Calling Kokkai API: ${url}`);
    
      try {
        const response = await fetch(url, {
          headers: {
            "User-Agent": "MCP Agent Kokkai Client/1.0",
          },
        });
    
        const responseData = (await response.json()) as any;
    
        if (!response.ok) {
          const errorMessage =
            responseData.message || "Unknown API error";
          const errorDetails = responseData.details
            ? responseData.details.join("; ")
            : "";
          console.error(
            `Kokkai API Error: ${errorMessage} ${errorDetails}`,
            responseData
          );
          return {
            error: true,
            status: response.status,
            message: errorMessage,
            details: errorDetails,
            rawResponse: responseData,
          };
        }
        return responseData;
      } catch (error: any) {
        console.error("Network or parsing error calling Kokkai API:", error);
        return {
          error: true,
          message:
            error.message || "Failed to fetch or parse API response.",
        };
      }
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: the tool is a search operation (implied read-only), returns basic meeting info, excludes speech text, and has a max record limit of 100. However, it lacks details on error handling, authentication needs, rate limits, or pagination behavior (beyond startRecord parameter), leaving gaps for a tool with 22 parameters.

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 front-loaded with essential information in three concise sentences: purpose, output format, and key constraint. Every sentence adds value without redundancy, making it efficient and well-structured for quick understanding.

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 complexity (22 parameters, no annotations, no output schema), the description is adequate but incomplete. It covers purpose, output scope, and a key limit, but lacks details on return format structure, error cases, or usage prerequisites. For a search tool with many parameters and no output schema, more context on result handling would be beneficial.

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?

Schema description coverage is 100%, so the schema fully documents all 22 parameters. The description adds no parameter-specific information beyond implying search functionality. It mentions 'Max 100 records' which relates to the maximumRecords parameter, but this is already covered in the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

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 action ('Searches for meeting summaries'), specifies the data source ('from the Kokkai API'), and distinguishes it from siblings by noting 'Does not include speech text' (unlike searchMeetingsWithSpeechText). It also specifies the output format ('basic info like meeting name, date, ID, URL') and a key constraint ('Max 100 records').

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

Usage Guidelines4/5

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

The description provides clear context by stating what this tool does not include ('Does not include speech text'), which implicitly guides users toward searchMeetingsWithSpeechText for speech content. However, it does not explicitly name alternatives or specify when not to use this tool beyond the speech text exclusion, missing full explicit guidance.

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/egegungordu/kokkaikaigiroku-mcp'

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