Skip to main content
Glama

get-current-context

Retrieve the active Azure DevOps authentication context for a specific directory, enabling integration with multiple organizations and projects.

Instructions

Get current Azure DevOps context based on directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directoryNoDirectory path to check (defaults to current working directory)

Implementation Reference

  • The primary handler function that executes the 'get-current-context' tool logic, returning the detected Azure DevOps context as JSON.
    private handleGetCurrentContext(args?: any): any {
      const directory = args?.directory || process.cwd();
      
      // If using local configuration, return current config
      if (!this.directoryDetector && this.currentConfig) {
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({
              organizationUrl: this.currentConfig.organizationUrl,
              project: this.currentConfig.project,
              directory: directory,
              configurationSource: 'local',
              configFile: '.azure-devops.json'
            }, null, 2),
          }],
        };
      }
    
      // Fall back to directory detector if available
      if (this.directoryDetector) {
        const context = this.directoryDetector.getProjectContext(directory);
        
        if (!context) {
          return {
            content: [{
              type: 'text',
              text: 'No Azure DevOps context configured for the specified directory.',
            }],
          };
        }
    
        return {
          content: [{
            type: 'text',
            text: JSON.stringify({
              organizationUrl: context.organizationUrl,
              project: context.projectName,
              directory: directory,
              configurationSource: 'environment',
              configuredDirectories: this.directoryDetector.getConfiguredDirectories(),
            }, null, 2),
          }],
        };
      }
    
      return {
        content: [{
          type: 'text',
          text: 'No Azure DevOps configuration found.',
        }],
      };
    }
  • src/index.ts:332-344 (registration)
    Registration of the 'get-current-context' tool in the ListToolsRequestSchema handler, including description and input schema definition.
    {
      name: 'get-current-context',
      description: 'Get current Azure DevOps context based on directory',
      inputSchema: {
        type: 'object',
        properties: {
          directory: {
            type: 'string',
            description: 'Directory path to check (defaults to current working directory)',
          },
        },
      },
    },
  • Input schema definition for the 'get-current-context' tool.
    inputSchema: {
      type: 'object',
      properties: {
        directory: {
          type: 'string',
          description: 'Directory path to check (defaults to current working directory)',
        },
      },
  • Helper method used by the handler to detect project context from directory via DirectoryDetector class.
    getProjectContext(currentDirectory?: string): { projectName: string; organizationUrl: string } | null {
      const config = this.detectConfiguration(currentDirectory);
      if (!config) {
        return null;
      }
    
      return {
        projectName: config.project,
        organizationUrl: config.organizationUrl
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool 'gets' context, implying a read-only operation, but doesn't disclose behavioral traits such as authentication requirements, rate limits, error conditions (e.g., invalid directory), or what 'context' includes (e.g., returns project ID, user info). For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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 a single, clear sentence that efficiently conveys the core purpose without unnecessary words. It's front-loaded with the main action and resource, making it easy to parse. Every part of the sentence earns its place by specifying Azure DevOps and the directory basis.

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

Completeness2/5

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

Given the complexity (context retrieval tool with no annotations and no output schema), the description is incomplete. It doesn't explain what 'context' means (e.g., project, repo, user details), the return format, or how this integrates with sibling tools. For a tool that likely provides foundational data for other operations, more context on its role and output is needed.

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?

The input schema has 1 parameter with 100% description coverage, documenting the directory path and default behavior. The description adds no additional parameter semantics beyond what's in the schema (e.g., doesn't explain how the directory influences context retrieval or format requirements). With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract.

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 action ('Get') and resource ('current Azure DevOps context'), specifying it's based on directory. It distinguishes from siblings like get-work-items or get-repositories by focusing on context rather than specific entities. However, it doesn't explicitly differentiate from all siblings (e.g., doesn't contrast with get-builds or get-pipeline-status).

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., Azure DevOps setup), when this context is needed (e.g., for other operations), or what 'context' entails (e.g., project, organization). With siblings like get-work-items or trigger-pipeline, there's no indication of how this tool fits into workflows.

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/wangkanai/devops-enhanced-mcp'

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