Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | /**
* @module Types/MCP
* @description Type definitions for the riksdag-regering-mcp JSON-RPC 2.0 client.
*/
// ---------------------------------------------------------------------------
// Client configuration
// ---------------------------------------------------------------------------
/** Configuration options for MCPClient */
export interface MCPClientConfig {
baseURL?: string;
serverUrl?: string;
timeout?: number;
maxRetries?: number;
headers?: Record<string, string>;
authToken?: string;
}
/** Runtime statistics for an MCPClient instance */
export interface MCPStats {
requests: number;
errors: number;
successRate: string;
}
// ---------------------------------------------------------------------------
// JSON-RPC 2.0 protocol
// ---------------------------------------------------------------------------
/** Outgoing JSON-RPC 2.0 request */
export interface JsonRpcRequest {
jsonrpc: '2.0';
id: number;
method: string;
params?: Record<string, unknown>;
}
/** Incoming JSON-RPC 2.0 response */
export interface JsonRpcResponse {
jsonrpc: '2.0';
id: number;
result?: unknown;
error?: { code: number; message: string; data?: unknown };
}
// ---------------------------------------------------------------------------
// Tool parameter types
// ---------------------------------------------------------------------------
/** Parameters for riksdag document search */
export interface SearchDocumentsParams {
titel?: string;
doktyp?: string;
subtyp?: string;
rm?: string;
organ?: string;
from_date?: string;
to_date?: string;
limit?: number;
[key: string]: unknown;
}
/** Parameters for parliamentary speech search */
export interface SearchSpeechesParams {
talare?: string;
parti?: string;
rm?: string;
text?: string;
limit?: number;
[key: string]: unknown;
}
/** Filters for MP (ledamot) lookup */
export interface FetchMPsFilters {
parti?: string;
valkrets?: string;
status?: string;
namn?: string;
limit?: number;
[key: string]: unknown;
}
/** Filters for voting record lookup */
export interface FetchVotingFilters {
rm?: string;
bet?: string;
punkt?: string;
iid?: string;
rost?: string;
limit?: number;
[key: string]: unknown;
}
/** Filters for party-level voting group lookup */
export interface FetchVotingGroupFilters {
bet?: string;
punkt?: string;
groupBy?: 'parti' | 'valkrets' | 'namn';
rm?: string;
limit?: number;
[key: string]: unknown;
}
/** Parameters for government document search */
export interface GovDocSearchParams {
title?: string;
type?: string;
departement?: string;
dateFrom?: string;
dateTo?: string;
limit?: number;
[key: string]: unknown;
}
// ---------------------------------------------------------------------------
// Data shapes
// ---------------------------------------------------------------------------
/** A riksdag document returned from the MCP server */
export interface RiksdagDocument {
dok_id?: string;
dokumentnamn?: string;
id?: string;
titel?: string;
rubrik?: string;
/** Raw Swedish document-type code from the API (e.g. 'mot', 'bet', 'prop', 'skr', 'ip', 'fr') */
doktyp?: string;
/** Normalized human-readable document type (e.g. 'motion', 'committee-report', 'proposition') */
type?: string;
/** Normalized human-readable document sub-type (mirrors API 'subtyp' field) */
subtype?: string;
/** Raw sub-type code from the API */
subtyp?: string;
organ?: string;
datum?: string;
summary?: string;
[key: string]: unknown;
}
|