deepsource-mcp-server
Version:
Model Context Protocol server for DeepSource
83 lines (82 loc) • 3.03 kB
TypeScript
import { MetricShortcode, MetricKey } from '../types/metrics.js';
/**
* Interface for parameters for fetching quality metrics
* @public
*/
export interface DeepsourceQualityMetricsParams {
/** DeepSource project key to fetch quality metrics for */
projectKey: string;
/** Optional filter for specific metric shortcodes */
shortcodeIn?: MetricShortcode[];
}
/**
* Interface for parameters for updating a metric threshold
* @public
*/
export interface DeepsourceUpdateMetricThresholdParams {
/** DeepSource project key to identify the project */
projectKey: string;
/** Repository GraphQL ID */
repositoryId: string;
/** Code for the metric to update */
metricShortcode: MetricShortcode;
/** Context key for the metric */
metricKey: MetricKey;
/** New threshold value, or null to remove */
thresholdValue?: number | null;
}
/**
* Interface for parameters for updating metric settings
* @public
*/
export interface DeepsourceUpdateMetricSettingParams {
/** DeepSource project key to identify the project */
projectKey: string;
/** Repository GraphQL ID */
repositoryId: string;
/** Code for the metric to update */
metricShortcode: MetricShortcode;
/** Whether the metric should be reported */
isReported: boolean;
/** Whether the threshold should be enforced */
isThresholdEnforced: boolean;
}
/**
* Fetches and returns quality metrics from a specified DeepSource project
* @param params - Parameters for fetching metrics, including project key and optional filters
* @returns A response containing the metrics data with their values and thresholds
* @throws Error if the DEEPSOURCE_API_KEY environment variable is not set
* @public
*/
export declare function handleDeepsourceQualityMetrics({ projectKey, shortcodeIn, }: DeepsourceQualityMetricsParams): Promise<{
content: {
type: "text";
text: string;
}[];
}>;
/**
* Updates the threshold for a specific metric in a project
* @param params - Parameters for updating the threshold
* @returns A response indicating whether the update was successful
* @throws Error if the DEEPSOURCE_API_KEY environment variable is not set
* @public
*/
export declare function handleDeepsourceUpdateMetricThreshold({ projectKey, repositoryId, metricShortcode, metricKey, thresholdValue, }: DeepsourceUpdateMetricThresholdParams): Promise<{
content: {
type: "text";
text: string;
}[];
}>;
/**
* Updates the settings for a specific metric in a project
* @param params - Parameters for updating the metric settings
* @returns A response indicating whether the update was successful
* @throws Error if the DEEPSOURCE_API_KEY environment variable is not set
* @public
*/
export declare function handleDeepsourceUpdateMetricSetting({ projectKey, repositoryId, metricShortcode, isReported, isThresholdEnforced, }: DeepsourceUpdateMetricSettingParams): Promise<{
content: {
type: "text";
text: string;
}[];
}>;